java awt 窗口关不掉,应该加什么?
importjava.awt.Frame;publicclasstext3{privateFramef;publictext3(){f=newFrame("Let'sst...
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);
}
public static void main(String[] args){
text3 guiWindow = new text3();
guiWindow.launchFrame();
}
} 展开
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);
}
public static void main(String[] args){
text3 guiWindow = new text3();
guiWindow.launchFrame();
}
} 展开
3个回答
展开全部
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();
}
}
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);
}
});
@Override public void windowClosing(WindowEvent e){
System.exit(0);
}
});
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询