import javax.swing.*;
import java.awt.*;
import java.awt.event.*;public class TextPad extends JFrame implements ActionListener{
public TextPad(){
super("一's笔记本");

JPanel jp = new JPanel(new GridLayout(1,1));

//定义菜单栏
JMenuBar jmb = new JMenuBar();

JMenu tfile = new JMenu("文件");
JMenuItem fnew = new JMenuItem("新建");
fnew.addActionListener(this);
JMenuItem fopen = new JMenuItem("打开");
fopen.addActionListener(this);
JMenuItem fsave = new JMenuItem("保存");
fsave.addActionListener(this);
JMenuItem fclose = new JMenuItem("关闭");
fclose.addActionListener(this);

tfile.add(fnew);
tfile.add(fopen);
tfile.add(fsave);
tfile.add(fclose);

JMenu tedit = new JMenu("编辑");
JMenuItem ecut = new JMenuItem("剪切");
ecut.addActionListener(this);
JMenuItem ecopy = new JMenuItem("粘贴");
ecopy.addActionListener(this);
JMenuItem epaste = new JMenuItem("复制");
epaste.addActionListener(this);
tedit.add(ecut);
tedit.add(ecopy);
tedit.add(epaste);

JMenu tstyle = new JMenu("格式");
JMenuItem sfont = new JMenuItem("字体");
sfont.addActionListener(this);
tstyle.add(sfont);

JMenu thelp = new JMenu("帮助");
JMenuItem habout = new JMenuItem("关于记事本");
habout.addActionListener(this);
thelp.add(habout);

jmb.add(tfile);
jmb.add(tedit);
jmb.add(tstyle);
jmb.add(thelp);


//定义文本区域
JTextArea ta = new JTextArea();
JScrollPane jssp = new JScrollPane(ta);


/*-------记事本布局------*/
jp.add(jssp);

this.setJMenuBar(jmb);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.getContentPane().add(jp);
this.setSize(800,600);
this.setVisible(true);

}

public void actionPerformed(ActionEvent e){
Object es = e.getSource();

if (es == fnew){
ta.setText("");
}else if(es == fopen){

}
}

public static void main(String[] arg){
new TextPad();
}
}各位帮忙看一下 郁闷阿 而且ta. 老是.不出来  我用的jcreator
问题就在这几行
if (es == fnew){
ta.setText("");
}else if(es == fopen){

}