Chris Johnson, Index
Buttons - Dont Just Compare Labels...
- Associate command id with button:
b1.setActionCommand(DISABLE);
- Create listener for the button:
b1.addActionListener(this);
- When listener called, get id:
String command = e.getActionCommand();
- Compare id for several buttons:
if (command == DISABLE)...