Paint getBorderPaint(Component button, boolean hasFocus) {
    AbstractButton b = (AbstractButton)button;
    Color borderColor = (Color)b.getClientProperty("JButton.borderColor");
    Rectangle r = new Rectangle(b.getSize());
    JBInsets.removeFrom(r, b.getInsets());
    boolean defButton = isDefaultButton(b);

    if (button.isEnabled()) {
      if (borderColor != null) {
        return borderColor;
      }
      else if (isGotItButton(button)) {
        return new GradientPaint(0, 0, getGotItBorderColorStart(b), 0, r.height, getGotItBorderColorEnd(b));
      }
      else if (hasFocus) {
        return JBUI.CurrentTheme.Button.focusBorderColor(defButton);
      }
      else {
        return new GradientPaint(0, 0, JBUI.CurrentTheme.Button.buttonOutlineColorStart(defButton),
                                 0, r.height, JBUI.CurrentTheme.Button.buttonOutlineColorEnd(defButton));
      }
    }
    else {
      return JBUI.CurrentTheme.Button.disabledOutlineColor();
    }
  }
Paint getBorderPaint(Component button, boolean hasFocus)