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:
parent
8ceaa74666
commit
d47101676b
@ -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) {
|
||||
g.setColor(color);
|
||||
g.fillRect(x, y, getIconWidth(), getIconHeight());
|
||||
if ( c.isEnabled() ){
|
||||
g.setColor(color);
|
||||
g.fillRect(x, y, getIconWidth(), getIconHeight());
|
||||
} else {
|
||||
g.setColor(color);
|
||||
g.drawRect(x, y, getIconWidth(), getIconHeight());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user