4 课后答案【khdaw_lxywyl】(15)
时间:2025-03-10
时间:2025-03-10
file_exit=new MenuItem("退出"); file.add(file_new); file.add(file_open); file.add(file_save); file.addSeparator(); file.add(file_exit);
edit_copy=new MenuItem("复制",new MenuShortcut(KeyEvent.VK_C)); edit_pase=new MenuItem("粘贴",new MenuShortcut(KeyEvent.VK_V)); edit_cut=new MenuItem("剪切",new MenuShortcut(KeyEvent.VK_X)); edit_del=new MenuItem("删除",new MenuShortcut(KeyEvent.VK_DELETE)); edit.add(edit_copy); edit.add(edit_pase); edit.add(edit_cut); edit.add(edit_del);
help_about=new MenuItem("关于"); help.add(help_about);
txtAr=new TextArea(8,10); Panel p1=new Panel(); btn_copy=new Button("复制"); btn_cut=new Button("剪切"); btn_pase=new Button("粘贴"); btn_del=new Button("删除"); p1.setLayout(new FlowLayout(FlowLayout.LEFT));
p1.add(btn_copy);p1.add(btn_cut);p1.add(btn_pase);p1.add(btn_del); add("North",p1); add("Center",txtAr); validate();
file_new.addActionListener(this); file_open.addActionListener(this); file_save.addActionListener(this); file_exit.addActionListener(this); edit_copy.addActionListener(this); edit_pase.addActionListener(this); edit_cut.addActionListener(this); edit_del.addActionListener(this); help_about.addActionListener(this); btn_copy.addActionListener(this); btn_cut.addActionListener(this); btn_pase.addActionListener(this); btn_del.addActionListener(this);
15
www.
khd
课
aw.
网
后
答
案
com
上一篇:小学生营养早餐食谱