if (b.hasFocus() && b.isFocusPainted())
if (b.isEnabled() && b.hasFocus() && b.isFocusPainted())
  protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect,          Rectangle textRect, Rectangle iconRect) {    if (b.hasFocus() && b.isFocusPainted())    {      Color savedColor = g.getColor();      g.setColor(getFocusColor());      Rectangle focusRect = iconRect.union(textRect);      g.drawRect(focusRect.x - 1, focusRect.y,                 focusRect.width + 1, focusRect.height);      g.setColor(savedColor);    }  }