码迷,mamicode.com
首页 > 编程语言 > 详细

【JAVA语言程序设计基础篇】--事件驱动程序设计--几个问题

时间:2016-08-16 17:37:03      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:

1.一个按钮能触发WindowEvent吗?一个按钮能触发MouseEvent吗?一个按钮能触发ActionEvent吗?
JButton能产生MouseEvent和ActionEvent。不能触发WindowEvent


2.一个源可以有多个监听器吗?一个监听器可以有多个源吗?一个监听器可以使自身的监听器吗?
YES.YES.YES




3.内部类可以用在不是嵌套他的其他类中吗?
Objects of an inner class are often created in the outer class. But you can also create an object of an inner class from another class. If the inner class is nonstatic, you must first create an instance of the outer class, then use the following syntax to create an object for the inner class:
OuterClass.InnerClass innerObject = outerObject.new InnerClass(); 


If the inner class is static, use the following syntax to create an object for it:
OuterClass.InnerClass innerObject = new OuterClass.InnerClass(); 

【JAVA语言程序设计基础篇】--事件驱动程序设计--几个问题

标签:

原文地址:http://blog.csdn.net/qq_24653023/article/details/52222678

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!