@Override
  public void paint(Graphics g2) {
    int iconSize = getIcon().getIconWidth();
    final Graphics2D g = (Graphics2D)g2;
    final GraphicsConfig config = GraphicsUtil.setupAAPainting(g);
    final int w = g.getClipBounds().width;
    final int h = g.getClipBounds().height;

    int borderArc = JBUIScale.scale(7);
    int border = JBUIScale.scale(1);
    int buttonArc = borderArc - border;

    g.setPaint(getBackgroundBorderPaint());
    g.fillRoundRect(0, 0, w, h, borderArc, borderArc);

    g.setPaint(getBackgroundPaint());
    g.fillRoundRect(border, border, w - 2 * border, h - 2 * border, buttonArc, buttonArc);

    g.setColor(getButtonForeground());
    g.drawString(getText(), myLeftRightBorder + iconSize + myHGap, getBaseline(w, h));
    getIcon().paintIcon(this, g, myLeftRightBorder, (getHeight() - getIcon().getIconHeight()) / 2);
    config.restore();
  }
@Override
  public void paint(Graphics g2)