Give a better indication that the button this colorIcon is on is disabled: Draw an empty outline rectangle if disabled, a filled rectangle if enabled.

This commit is contained in:
Bill Kuker 2012-07-02 18:44:02 +00:00 committed by U-WINDOWS-C28163E\Administrator
parent 8ceaa74666
commit d47101676b

View File

@ -34,8 +34,13 @@ public class ColorIcon implements Icon {
@Override
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y) {
if ( c.isEnabled() ){
g.setColor(color);
g.fillRect(x, y, getIconWidth(), getIconHeight());
} else {
g.setColor(color);
g.drawRect(x, y, getIconWidth(), getIconHeight());
}
}
}