@Override
  protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) {
    g.setColor(darkShadow);
    switch (tabPlacement) {
      case TOP -> {
        if (isSelected) {
          // left
          LinePainter2D.paint((Graphics2D)g, x, y + 1, x, y + h - 1);
          // top
          LinePainter2D.paint((Graphics2D)g, x + 1, y, x + w - 3, y);
          // right
          LinePainter2D.paint((Graphics2D)g, x + w - 2, y + 1, x + w - 2, y + h - 1);
        }
        else {
          // left
          LinePainter2D.paint((Graphics2D)g, x, y + 1, x, y + h - 1);
          // top
          LinePainter2D.paint((Graphics2D)g, x + 1, y, x + w - 3, y);
          // right
          LinePainter2D.paint((Graphics2D)g, x + w - 2, y + 1, x + w - 2, y + h - 1);
        }
      }
      case LEFT -> {
        // top
        LinePainter2D.paint((Graphics2D)g, x + 1, y + 1, x + w - 1, y + 1);
        // left
        LinePainter2D.paint((Graphics2D)g, x, y + 2, x, y + h - 2);
        //bottom
        LinePainter2D.paint((Graphics2D)g, x + 1, y + h - 1, x + w - 1, y + h - 1);
      }
      case BOTTOM -> {
        if (isSelected) {
          // left
          LinePainter2D.paint((Graphics2D)g, x, y, x, y + h - 2);
          // bottom
          LinePainter2D.paint((Graphics2D)g, x + 1, y + h - 1, x + w - 2, y + h - 1);
          // right
          LinePainter2D.paint((Graphics2D)g, x + w - 1, y, x + w - 1, y + h - 2);
        }
        else {
          // left
          LinePainter2D.paint((Graphics2D)g, x, y, x, y + h - 1);
          // bottom
          LinePainter2D.paint((Graphics2D)g, x + 1, y + h - 1, x + w - 3, y + h - 1);
          // right
          LinePainter2D.paint((Graphics2D)g, x + w - 2, y, x + w - 2, y + h - 1);
        }
      }
      case RIGHT -> {
        // top
        LinePainter2D.paint((Graphics2D)g, x, y + 1, x + w - 2, y + 1);
        // right
        LinePainter2D.paint((Graphics2D)g, x + w - 1, y + 2, x + w - 1, y + h - 2);
        //bottom
        LinePainter2D.paint((Graphics2D)g, x, y + h - 1, x + w - 2, y + h - 1);
      }
      default -> {
        throw new IllegalArgumentException("unknown tabPlacement: " + tabPlacement);
      }
    }
  }
@Override
  protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)