The JavaTM Tutorial

| Start of Tutorial > Start of Trail > Start of Lesson | Search

Trail: JDK(TM) 1.1 -- And Beyond!
Lesson: Migrating to 1.1

## Event-Conversion Table

> The following table maps 1.0 events to their 1.1 counterparts. The first column lists each 1.0 event type, along with the name of the method (if any) that's specific to the event. Where no method is listed, the event is always handled in the `handleEvent` method. The second column lists the 1.0 components that can generate the event type. The third column lists the listener interface that helps you handle the 1.1 equivalents of the listed events. The fourth column lists the methods in each listener interface.

> 1.0 | 1.1
> --- | ---
> Event/Method | Generated By | Interface | Methods
> `ACTION_EVENT/action` | `Button`, `List`, `MenuItem`, `TextField` | `ActionListener` | `actionPerformed(ActionEvent)`
> `Checkbox`, `CheckboxMenuItem`, `Choice` | `ItemListener` | `itemStateChanged(ItemEvent)`
> `WINDOW_DESTROY` `WINDOW_EXPOSE` `WINDOW_ICONIFY` `WINDOW_DEICONIFY` | `Dialog`, `Frame` | `WindowListener` | `windowClosing(WindowEvent)` `windowOpened(WindowEvent)` `windowIconified(WindowEvent)` `windowDeiconified(WindowEvent)` `windowClosed(WindowEvent)` (no 1.0 equivalent) `windowActivated(WindowEvent)` (no 1.0 equivalent) `windowDeactivated(WindowEvent)` (no 1.0 equivalent)
> `WINDOW_MOVED` | `Dialog`, `Frame` | `ComponentListener` | `componentMoved(ComponentEvent) componentHidden(ComponentEvent) (no 1.0 equivalent) componentResized(ComponentEvent) (no 1.0 equivalent) componentShown(ComponentEvent) (no 1.0 equivalent)`
> `SCROLL_LINE_UP` `SCROLL_LINE_DOWN` `SCROLL_PAGE_UP` `SCROLL_PAGE_DOWN` `SCROLL_ABSOLUTE` `SCROLL_BEGIN` `SCROLL_END` | `Scrollbar` | `AdjustmentListener` (or use the new `ScrollPane` class) | `adjustmentValueChanged(AdjustmentEvent)`
> `LIST_SELECT` `LIST_DESELECT` | `Checkbox`, `CheckboxMenuItem`, `Choice`, `List` | `ItemListener` | `itemStateChanged(ItemEvent)`
> `MOUSE_DRAG/mouseDrag` `MOUSE_MOVE/mouseMove` | `Canvas`, `Dialog`, `Frame`, `Panel`, `Window` | `MouseMotionListener` | `mouseDragged(MouseEvent)` `mouseMoved(MouseEvent)`
> `MOUSE_DOWN/mouseDown` `MOUSE_UP/mouseUp` `MOUSE_ENTER/mouseEnter` `MOUSE_EXIT/mouseExit` | `Canvas`, `Dialog`, `Frame`, `Panel`, `Window` | `MouseListener` | `mousePressed(MouseEvent)` `mouseReleased(MouseEvent)` `mouseEntered(MouseEvent)` `mouseExited(MouseEvent)` `mouseClicked(MouseEvent)` (no 1.0 equivalent)
> `KEY_PRESS/keyDown` `KEY_RELEASE/keyUp` `KEY_ACTION/keyDown` `KEY_ACTION_RELEASE/keyUp` | `Component` | `KeyListener` | `keyPressed(KeyEvent)` `keyReleased(KeyEvent)` `keyTyped(KeyEvent)` (no 1.0 equivalent)
> `GOT_FOCUS/gotFocus` `LOST_FOCUS/lostFocus` | `Component` | `FocusListener` | `focusGained(FocusEvent)` `focusLost(FocusEvent)`
> No 1.0 equivalent. | `ContainerListener` | `componentAdded(ContainerEvent)` `componentRemoved(ContainerEvent)`
> No 1.0 equivalent. | `TextListener` | `textValueChanged(TextEvent)`

| Start of Tutorial > Start of Trail > Start of Lesson | Search