java编译文本编辑器

来源:百度知道 编辑:UC知道 时间:2024/09/21 09:14:42
速度啊
作业啊

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class EditorJFrame extends JFrame implements ActionListener, ItemListener, MouseListener
{
private JTextField text_size; //字号文本行
private JCheckBox checkbox_bold, checkbox_italic; //粗体、斜体复选框
private JButton button_cut, button_copy, button_paste; //剪切、复制、粘贴按钮
private JTextArea textarea; //文本区

private JPopupMenu popupmenu; //快捷菜单
private JDialog dialog; //出错提示对话框
private JLabel label_dialog; //对话框中的标签

public EditorJFrame()
{
super("文本编辑器"); //默认BorderLayout布局

this.setSize(500,300);
this.setLocation(300,240);
this.setDefaultCloseOperation(EXIT_ON_CLOSE