编写一个Java程序,模拟Notepad记事本的功能,在输入框中输入文字,单击“保存”按钮时自动将文字保存到testout.txt中,程序我写了一半,不会写了,求大侠帮忙,不剩感激~~
import java.awt.*;
import java.awt.event.*;public class Notepad extends WindowAdapter {

Frame f;
TextArea text1; public static void main(String[] args) {
new Notepad();
}

public Notepad(){
f=new Frame("TxstArea_刘阳");
text1=new TextArea();
f.add(text1);
f.addWindowListener(new WindowEvent_1());
f.addTextListener(new TextEvent_1());
f.setSize(400,300);
f.setVisible(true);

}

class WindowEvent_1 extends WindowAdapter {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
}

class TextEvent_1 implements TextListener{
public void textValueChanged(TextEvent arg0) {

}

}}