import java.awt.Frame;
public class text3{
private Frame f;
public text3(){
f = new Frame("Let's study java");
}
public void launchFrame(){
f.setSize(400,200);
f.setVisible(true);
f.setdefaultoperation(dispose......)有这方法,具体我记不得了,
}
public static void main(String[] args){
text3 guiWindow = new text3();
guiWindow.launchFrame();
}
}
f.addWindowListener(new WindowAdapter(){
@Override public void windowClosing(WindowEvent e){
System.exit(0);
}
});
ctrl加ait加.