Jafe Lee

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  49 随笔 :: 0 文章 :: 24 评论 :: 0 Trackbacks
1、AWT事件继承层次
awtevent.JPG

2、常用AWT事件类型列表
ActionEvent     KeyEvent
AdjustmentEvent     MouseEvent
FocusEvent     MouseWheelEvent
ItemEvent     WindowEvent


用于监听这些事件的接口:
ActionListener                  MouseMotionListener
AdjustmentListener MouseWheelListener
FocusListener WindowListener
ItemListener WindowFocusListener
KeyListener WindowStateListener
MouseListener


常用的适配器类:
FocusAdapter MouseMotionAdapter
KeyAdapter WindowAdapter
MouseAdapter


3、事件监听原理:
接收事件的类必须实现监听接口,这个类要用事件源注册,然后,接受所需要的事件对象,并通过监听器接口中的方法对事件作出相应的处理

4、所有AWT事件源都支持多点传送(multicast)模型,即同一个事件可以发送给多个监听器对象。当时API不能保证一个给定事件源注册的一组监听器传送事件的次序,因此不要编写依赖传送次序的程序逻辑。
posted on 2007-07-23 15:47 Jafe Lee 阅读(234) 评论(0)  编辑  收藏 所属分类: Java

只有注册用户登录后才能发表评论。


网站导航: