Widget Example: JButtons
The java.swing.JButton class implements a state version of a java.swing.AbstractButton. Many methods come from the abstract class:
- A variety of constructors (Strings, Icons, etc.);
- setRolloverEnabled(boolean);
- setIcon(Icon);
- setRolloverIcon(Icon);
- setActionCommand(String); -- an extra String tacked onto the event that gets fired!
- setContentAreaFilled(boolean) -- transparency for icons!
- setModel(ButtonModel); -- sets the ‘type’ of Button (you can define your own Button behaviors!)
- setMnemonic(char/int); -- set mnemonics for button