Thinking in Java, 3rd ed. Revision 2.0: 14: Creating ...
2002-9-14 · So all you have to do to attach code to a JButton is to implement the ActionListener interface in a class, and register an object of that class with the JButton via addActionListener( ). The method will be called when the button is pressed (this is normally referred to as a callback). Comment. But what should the result of pressing that button be?
Get Price