| 60 | |
| 61 | |
| 62 | @Override |
| 63 | public void update(Graphics g, JComponent c) { |
| 64 | ButtonModel model = ((AbstractButton) c).getModel(); |
| 65 | |
| 66 | // if (c.isOpaque()) { |
| 67 | //g.setColor(c.getBackground()); |
| 68 | //g.fillRect(0, 0, c.getWidth(),c.getHeight()); |
| 69 | if (model.isPressed()) { |
| 70 | g.setColor(pressedBgColor); |
| 71 | } else if (model.isEnabled()) { |
| 72 | g.setColor(enabledBgColor); |
| 73 | } else { |
| 74 | g.setColor(disabledBgColor); |
| 75 | } |
| 76 | //g.setColor(c.isEnabled() ? bgColor : disabledBgColor); |
| 77 | Toolkit.prepareGraphics(g); |
| 78 | g.fillRoundRect(0, 0, c.getWidth(), c.getHeight(), 8, 8); |
| 79 | // } |
| 80 | paint(g, c); |
| 81 | } |
| 82 | |
| 83 | |
| 84 | /* |