public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
AbstractButton button = (AbstractButton) c;
ButtonModel model = button.getModel();
Color frameColor = ColorHelper.darker(button.getBackground(), 30);
if (model.isEnabled()) {
if ((model.isPressed() && model.isArmed()) || model.isSelected()) {
g.setColor(frameColor);
g.drawRect(x, y, w - 1, h - 1);
} else {
g.setColor(frameColor);
g.drawRect(x, y, w - 1, h - 1);
g.setColor(ColorHelper.brighter(button.getBackground(), 40));
g.drawLine(x + 1, y + 1, x + w - 2, y + 1);
g.drawLine(x + 1, y + 1, x + 1, y + h - 2);
}
if (c instanceof JButton) {
JButton b = (JButton) c;
if (b.getRootPane() != null && b.equals(b.getRootPane().getDefaultButton())) {
g.setColor(defaultFrameColor);
g.drawRect(x, y, w - 1, h - 1);
}
}
} else {
g.setColor(AbstractLookAndFeel.getDisabledForegroundColor());
g.drawRect(x, y, w - 1, h - 1);
}
}