Even handling in
Java 2 is done using event listeners. You have several options for using them.
1. Use an anomyous listener for every button
i.e. ( jbutton1.addActionListenr(new ActionListener(){
public void actionPerformed(ActionCommand C)
{
System.out.println("Hello World");
}
});
2. Create one listener that checks for either a source or a message command using getSource() or getMessageCommand() respectively.
3. Use "Command"
pattern (read the Gang of 4 book on design patterns of Java Design Patterns book.