setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);是
来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/08/01 06:00:11
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);是什么意思
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
他与
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
有啥区别呢
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
他与
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
有啥区别呢
![setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);是](/uploads/image/z/15253159-31-9.jpg?t=setDefaultCloseOperation%28WindowConstants.DISPOSE_ON_CLOSE%29%3B%E6%98%AF)
你可以通过程序来输出两个的值:
System.out.println("11:"+JFrame.DISPOSE_ON_CLOSE);
System.out.println("12:"+WindowConstants.DISPOSE_ON_CLOSE);
你会发现两个的值都是2
所以单从值上面来看,没有区别.
但是两个定义的位置不一样,所以从合理性的角度来看,当你在JFrame中操作时应该用JFrame.DISPOSE_ON_CLOSE,当你在Window中操作时,应该用WindowConstants.DISPOSE_ON_CLOSE.
System.out.println("11:"+JFrame.DISPOSE_ON_CLOSE);
System.out.println("12:"+WindowConstants.DISPOSE_ON_CLOSE);
你会发现两个的值都是2
所以单从值上面来看,没有区别.
但是两个定义的位置不一样,所以从合理性的角度来看,当你在JFrame中操作时应该用JFrame.DISPOSE_ON_CLOSE,当你在Window中操作时,应该用WindowConstants.DISPOSE_ON_CLOSE.
setDefaultCloseOperation(DISPOSE_ON_CLOSE)是什么意思
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 和 syst
.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) 起到什么作用
是~
合作是-------------------,是---------------------,是-------------
是 体育 是 科学 是
造句:地球,是 ,是 ,是 .
尼亚加拉瀑布是 是 是
尼亚加拉大瀑布,是.,是.,是.
母亲是(),是();我们是(),是()造句
猪是繁体字是
是打发斯蒂芬是