01: package vicazh.hyperpool;
02:
03: import javax.swing.*;
04:
05: /**
06: * The button
07: *
08: * @author Victor Zhigunov
09: * @version 0.3.3
10: */
11: public class IButton extends JButton {
12: private Object keyIcon;
13:
14: private Object keyDisabledIcon;
15:
16: public IButton(Object keyIcon) {
17: this (keyIcon, null);
18: }
19:
20: public IButton(Object keyIcon, Object keyDisabledIcon) {
21: this .keyIcon = keyIcon;
22: this .keyDisabledIcon = keyDisabledIcon;
23: updateUI();
24: }
25:
26: public void updateUI() {
27: if (keyIcon != null)
28: setIcon(UIManager.getIcon(keyIcon));
29: if (keyDisabledIcon != null)
30: setDisabledIcon(UIManager.getIcon(keyDisabledIcon));
31: super.updateUI();
32: }
33: }
|