@Override
  protected void paintComponent(Graphics g) {
    setForeground(getTextColor());
    super.paintComponent(g);

    if (getText() != null) {
      Color underlineColor = getUnderlineColor();

      if (underlineColor != null) {
        g.setColor(underlineColor);
        Rectangle bounds = getTextBounds();
        int lineY = getUI().getBaseline(this, getWidth(), getHeight()) + getUnderlineShift();
        g.drawLine(bounds.x, lineY, bounds.x + bounds.width, lineY);
      }

      g.setColor(getTextColor());

      if (g instanceof Graphics2D && isFocusOwner()) {
        g.setColor(JBUI.CurrentTheme.Link.FOCUSED_BORDER_COLOR);
        Rectangle bounds = getTextBounds();
        int round = Registry.intValue("ide.link.button.focus.round.arc", 4);
        RectanglePainter.DRAW.paint((Graphics2D)g, bounds.x, bounds.y, bounds.width, bounds.height, JBUI.scale(round));
      }
    }
  }
@Override
  protected void paintComponent(Graphics g)