private JButton createArrow(@MagicConstant(intValues = {SwingConstants.NORTH, SwingConstants.SOUTH}) int direction) {
    BasicArrowButton b = new BasicArrowButton(direction) {
      @Override
      public void paint(Graphics g) {
        paintArrowButton(g, this, direction);
      }

      @Override
      public boolean isOpaque() {
        return false;
      }

      @Override
      public void paintTriangle(Graphics g, int x, int y, int size, int direction, boolean isEnabled) {
        Graphics2D g2 = (Graphics2D)g.create();
        try {
          g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
          g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
                              MacUIUtil.USE_QUARTZ ? RenderingHints.VALUE_STROKE_PURE : RenderingHints.VALUE_STROKE_NORMALIZE);

          float lw = LW.getFloat();
          float bw = BW.getFloat();

          g2.setColor(JBUI.CurrentTheme.Arrow.backgroundColor(isEnabled, true));
          g2.fill(getInnerShape(lw, bw));

          // Paint side line
          int h = getHeight() - JBUIScale.scale(1);
          Rectangle2D sideLine = direction == NORTH ?
                                 new Rectangle2D.Float(0, bw + lw, lw, h - (bw + lw)) :
                                 new Rectangle2D.Float(0, 0, lw, h - (bw + lw));

          g2.setColor(getOutlineColor(spinner.isEnabled(), false));
          g2.fill(sideLine);

          // Paint arrow
          g2.translate(x, y);
          g2.setColor(JBUI.CurrentTheme.Arrow.foregroundColor(isEnabled));
          g2.fill(getArrowShape());
        }
        finally {
          g2.dispose();
        }
      }

      private Shape getInnerShape(float lw, float bw) {
        Path2D shape = new Path2D.Float();
        int w = getWidth() - JBUIScale.scale(1);
        int h = getHeight() - JBUIScale.scale(1);
        float arc = COMPONENT_ARC.getFloat();
        arc = arc > bw + lw ? arc - bw - lw : 0.0f;

        switch (direction) {
          case SOUTH -> {
            shape.moveTo(lw, 0);
            shape.lineTo(w - bw - lw, 0);
            shape.lineTo(w - bw - lw, h - bw - lw - arc);
            shape.quadTo(w - bw - lw, h - bw - lw, w - bw - lw - arc, h - bw - lw);
            shape.lineTo(lw, h - bw - lw);
            shape.closePath();
          }
          case NORTH -> {
            shape.moveTo(lw, bw + lw);
            shape.lineTo(w - bw - lw - arc, bw + lw);
            shape.quadTo(w - bw - lw, bw + lw, w - bw - lw, bw + lw + arc);
            shape.lineTo(w - bw - lw, h);
            shape.lineTo(lw, h);
            shape.closePath();
          }
          default -> {}
        }
        return shape;
      }

      private Shape getArrowShape() {
        Path2D arrow = new Path2D.Float();
        int aw = ARROW_WIDTH.get();
        int ah = ARROW_HEIGHT.get();

        switch (direction) {
          case SOUTH -> {
            arrow.moveTo(0, 0);
            arrow.lineTo(aw, 0);
            arrow.lineTo(aw / 2.0, ah);
            arrow.closePath();
          }
          case NORTH -> {
            arrow.moveTo(0, 0);
            arrow.lineTo(aw, 0);
            arrow.lineTo(aw / 2.0, -ah);
            arrow.closePath();
          }
          default -> {}
        }

        return arrow;
      }

      @Override
      public Dimension getPreferredSize() {
        Insets i = spinner.getInsets();
        int minHeight = isCompact(spinner) ? JBUIScale.scale(10) : JBUIScale.scale(12);
        return new Dimension(JBUI.CurrentTheme.Component.ARROW_AREA_WIDTH.get() + i.right,
                             minHeight + (direction == SwingConstants.NORTH ? i.top : i.bottom));
      }
    };

    b.setInheritsPopupMenu(true);
    b.setBorder(JBUI.Borders.empty());

    return b;
  }
private JButton createArrow(@MagicConstant(intValues = {SwingConstants.NORTH, SwingConstants.SOUTH}) int direction)