1 LESSON 13: Event & Swing 吴砥 ******@hust. Department of Electronics & Information Engineering, Huazhong University of Science & Technology, Wuhan, . . 2 Outline The package Event processing Swing 3 The Package 4 The interfaces in ActionListener AdjustmentListener AWTEventListener ComponentListener ContainerListener FocusListener HierarchyBoundsListener HierarchyListener InputMethodListener ItemListener KeyListener MouseListener MouseMotionListener MouseWheelListener TextListener WindowFocusListener WindowListener WindowStateListener 5 The classes in ActionEvent AdjustmentEvent AWTEventListenerProxy ComponentAdapter ComponentEvent ContainerAdapter ContainerEvent FocusAdapter FocusEvent HierarchyBoundsAdapter HierarchyEvent InputEvent InputMethodEvent InvocationEvent ItemEvent KeyAdapter KeyEvent MouseAdapter MouseEvent MouseMotionAdapter MouseWheelEvent PaintEvent TextEvent WindowAdapter WindowEvent 7 Event Processing 8 The process of event handling 9 The types of AWT events Low-level ponentEvent ContainerEvent WindowEvent FocusEvent KeyEvent MouseEvent High-level events ActionEvent AdjustmentEvent ItemEvent TextEvent 10 Window events A low-level event that indicates that a window has changed its status. This low-level event is generated by a Window object when it is opened, closed, activated, deactivated, iconified, or deiconified, or when focus is transfered into or out of the Window. The class WindowEvent Methods: getOldState() getNewState() getWindow()