import java.awt.Color; |
2. 이벤트 종류. (자바는 이벤트 종류가 많지않다.)
Action |
ActionListener |
actionPerformed(ActionEvent ActionEvent) |
Item |
ItemListener |
itemStateChanged(ItemEvent ItemEvent) |
Mouse |
MouseListener |
mousePressed(MouseEvent MouseEvent) |
MouseMotion |
MouseMotionLi |
mouseDragged(MouseEvent MouseEvent) |
Key |
KeyListener |
keyPressed(KeyEvent KeyEvent) keyReleased(KeyEvent KeyEvent) keyTyped(KeyEvent KeyEvent) |
Focus |
FocusListener |
focusGained(FocusEvent FocusEvent) focusLost(FocusEvent FocusEvent) |
Adjustment |
AdjustmentListener |
adjustmentValueChanged(Adjustment AdjustmentEvent Event) |
Component |
ComponnetListener |
componentMoved(ComponentEvent ComponentEvent) componentHidden(ComponentEventcomponentHidden(ComponentEvent) componentResized(ComponentEventcomponentResized(ComponentEvent) componentShown(ComponentEvent ComponentEvent) |
Window |
WindowListener |
windowClosing(WindowEvent WindowEvent) windowOpened(WindowEvent WindowEvent) windowIconified(WindowEvent WindowEvent) windowDeiconfied(WindowEvent WindowEvent) windowClosed(WindowEvent WindowEvent) windowActivated(WindowEvent WindowEvent) windowDeactivated(WindowEvent WindowEvent) |
Container |
ContainerListener |
componentAdded(ContainerEvent ContainerEvent) componentRemoved(ContainerEvent ContainerEvent) |
Text |
TextListener |
textValueChanged(TextEvent TextEvent) |
3. Adapter
1) 이벤트 Listener들을 이미 상속받은 클래스로 필요한 메소드만 재정의 하여 쓸 수 있게된다. (코드 간소화)
'Programming > JAVA' 카테고리의 다른 글
Java Call by value, Call by reference (2) | 2011.03.24 |
---|---|
The AWT Component Library (1) | 2011.03.24 |
Building GUIs & Java Graphics (0) | 2011.03.24 |
Java Core Packages (2) | 2011.03.24 |
Java Collections Framework (2) | 2011.03.24 |