public static void main(String[] args) {
Notepad np = new Notepad();
}
//构造函数
public Notepad(){
//创建jta
jta = new JTextArea();
jmb = new JMenuBar();
jm1 = new JMenu("文件");
//设置助记符
jm1.setMnemonic(‘F‘);
jmi1 = new JMenuItem("打开");
//注册监听
jmi1.addActionListener(this);
jmi1.setActionCommand("open");
jmi2 = new JMenuItem("保存");