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
|
@Override
|
||||||
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y) {
|
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y) {
|
||||||
g.setColor(color);
|
if ( c.isEnabled() ){
|
||||||
g.fillRect(x, y, getIconWidth(), getIconHeight());
|
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