快速业务通道

事件和接收者类型(java) - 编程入门网

作者 佚名技术 来源 NET编程 浏览 发布时间 2012-06-25

事件和接收者类型(java)

时间:2007-05-29 yycnet.yeah.net yyc译

所有AWT组件都被改变成包含addXXXListener()和removeXXXListener()方法,因此特定的接收器类型可从每个组件中增加和删除。

我们会注意到“XXX”在每个场合中同样表示自变量的方法,例如,addFooListener(FooListener fl)。

下面这张表格总结了通过提供addXXXListener()和removeXXXListener()方法,从而支持那些特定事件的相关事件、接收器、方法以及组件。事件,接收器接口及添加和删除方法 支持这个事件的组件

Event, listener interface and add- and remove-methods

Components supporting this event

ActionEventActionListeneraddActionListener()removeActionListener()

Button, List, TextField, MenuItem, and its derivatives including CheckboxMenuItem, Menu, and PopupMenu

AdjustmentEventAdjustmentListeneraddAdjustmentListener()removeAdjustmentListener()

ScrollbarAnything you create that implements the Adjustable interface

ComponentEventComponentListeneraddComponentListener()removeComponentListener()

Component and its derivatives, including Button, Canvas, Checkbox, Choice, Container, Panel, Applet, ScrollPane, Window, Dialog, FileDialog, Frame, Label, List, Scrollbar, TextArea, and TextField

ContainerEventContainerListeneraddContainerListener()removeContainerListener()

Container and its derivatives, including Panel, Applet, ScrollPane, Window, Dialog, FileDialog, and Frame

FocusEventFocusListeneraddFocusListener()removeFocusListener()

Component and its derivatives, including Button, Canvas, Checkbox, Choice, Container, Panel, Applet, ScrollPane, Window, Dialog, FileDialog, Frame Label, List, Scrollbar, TextArea, and TextField

KeyEventKeyListeneraddKeyListener()removeKeyListener()

Component and its derivatives, including Button, Canvas, Checkbox, Choice, Container, Panel, Applet, ScrollPane, Window, Dialog, FileDialog, Frame, Label, List, Scrollbar, TextArea, and TextField

MouseEvent (for both clicks and motion)MouseListeneraddMouseListener()removeMouseListener()

Component and its derivatives, including Button, Canvas, Checkbox, Choice, Container, Panel, Applet, ScrollPane, Window, Dialog, FileDialog, Frame, Label, List, Scrollbar, TextArea, and TextField

MouseEvent[55] (for both clicks and motion)MouseMotionListeneraddMouseMotionListener()removeMouseMotionListener()

Component and its derivatives, including Button, Canvas, Checkbox, Choice, Container, Panel, Applet, ScrollPane, Window, Dialog, FileDialog, Frame, Label, List, Scrollbar, TextArea, and TextField

WindowEventWindowListeneraddWindowListener()removeWindowListener()

Window and its derivatives, including Dialog, FileDialog, and Frame

ItemEventItemListeneraddItemListener()removeItemListener()

Checkbox, CheckboxMenuItem, Choice, List, and anything that implements the ItemSelectable interface

TextEventTextListeneraddTextListener()removeTextListener()

Anything derived from TextComponent, including TextArea and TextField

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号