III- Gestions des événements
▪ Pour gérer les événements et les actions Java dispose de plusieurs interface nommées
‘Listeners’ (écouteurs) :
• ActionListener
• MouseListener
• MouseMotionListener
• ItemListener
• KeyListener
• TextListener
• WindowListener
23
public void actionPerformed(ActionEvent e);
public void mouseClicked(MouseEvent e);
public void mouseEntered(MouseEvent e);
public void mouseExited(MouseEvent e);
public void mousePressed(MouseEvent e);
public void mouseReleased(MouseEvent e);
public abstract void mouseDragged(MouseEvent e);
public abstract void mouseMoved(MouseEvent e);
public void itemStateChanged(ItemEvent e);
public void keyPressed(KeyEvent e);
public void keyReleased(KeyEvent e);
public void keyTyped(KeyEvent e);
Public TextValueChanged(TextEvent e)
public void windowActivated(WindowEvent e);
public void windowClosed(WindowEvent e);
public void windowClosing(WindowEvent e);
public void windowDeactivated(WindowEvent e);
public void windowDeiconified(WindowEvent e);
public void windowIconified(WindowEvent e);
public void windowOpened(WindowEvent e);
1- Interfaces des écouteurs « Listeners»
Interfaces Graphiques