Næste |
|
Swing'it! serie, Planche nr. 21 |
![]() |
Ex.: Hændelser |
public class SwingApplication implements ActionListener { ... public SwingApplication() { ... button.addActionListener(this); ... frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); ... } public void actionPerformed(ActionEvent e) { numClicks++; label.setText(labelPrefix + numClicks); } ... }