- 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Java图形用户界面设计AWT全解
MouseEvent 鼠标移动 MouseListener mouseDragged(MouseEvent) mouseMoved(MouseEvent) MouseEvent 鼠标点击等 MouseListener mousePressed(MouseEvent) mouseReleased(MouseEvent) mouseEntered(MouseEvent) mouseExited(MouseEvent) mouseClicked(MouseEvent) KeyEvent 键盘输入 KeyListener KeyPressed(KeyEvent) KeyReleased(KeyEvent) KeyTyped(KeyEvent) FocusEvent 组件收到或失去焦点 FocusListener focusGained(FocusEvent) focusLost(focusEvent) AdjustementEvent 移动了滚动条等组件 AdjustmentListener adjustmentValueChanged(AdjustmentEvent) ComponentEvent 对象移动缩放显示隐藏等 ComponentListener componentMoved(ComponentEvent) componentHidden(ComponentEvent) componentResized(ComponentEvent) componentShown(ComponentEvent) WindowEvent 窗口收到窗口级事件 WindowListener windowClosing(WindowEvent) windowOpened(WindowEvent) windowIconified(WindowEvent) windowDeiconified(WindowEvent) windowClosed(WindowEvent) windowActivated(WindowEvent) windowDeactivated(WindowEvent) ContainerEvent 容器中增加删除了组件 ContainerListener componentAdded(containerEvent) componentRemoved(containerEvent) TextEvent 文本字段或文本区发生改变 TextListener textValueChanged(TextEvent) 例12.12 import java.awt.*; import java.awt.event.*; public class TwoListen implements MouseMotionListener,MouseListener,WindowListener { private Frame f; private TextField tf; public static void main(String args[]) { TwoListen two = new TwoListen(); two.go(); } public void go() { f = new Frame(Two listeners example); f.add(new Label(Click and drag the mouse),North); tf = new TextField(30); f.add(tf,South); f.addMouseMotionListener(this); f.addMouseListener(this); f.addWindowListener(this); f.setSize(300,200); f.setVisible(true); } public void mouseDragged (MouseEvent e) { String s = Mouse dragging : X=+e.getX()+Y = +e.getY(); tf.setText(s); } public void mouseMoved(MouseEvent e){} public void mouseClicked(MouseEvent e){} public void mouseEntered(MouseEvent e){ String s = The mouse entered; tf.setText(s);
您可能关注的文档
最近下载
- 矿山用地审批及土地使用权证的办理.docx VIP
- 高中生职业生涯规划课件(共33张课件).pptx VIP
- TB 10106-2023铁路工程地基处理技术规程.pdf
- 《核磁共振波谱学》第5讲二维核磁共振谱介绍.ppt
- 降低住院患者2期及以上院内压力性损伤发生率.pptx VIP
- 部编人教版九年级上册语文课外古诗词诵读1左迁至蓝关示侄孙湘.ppt VIP
- 大数据试题及答案.docx
- 老年人头晕/眩晕诊疗多学科专家共识(2021).pdf VIP
- 2024秋人教PEP版三年级英语上册Unit 1 Making friends 单元分层作业设计.docx
- DL5T 5342-2006 750kV架空送电线路铁塔组立施工工艺导则.pdf VIP
文档评论(0)