code: private Icon createIcon(SortOrder sortOrder, int sortPriority)
      {
          final Color color = UIManager.getColor("controlDkShadow");
          final int width = 12;
          final int height = 12;
          final int sizeX = Math.max(2, width - sortPriority * 2);
          final int sizeY = Math.max(2, height - sortPriority * 2);
          final int space = (height - sizeY) / 2;
          final Shape shape = 
              sortOrder == SortOrder.ASCENDING ?
                  createArrowShape(sizeX, space, height-space) :
                  createArrowShape(sizeX, height-space, space);
          return new Icon()
          {
              @Override
              public void paintIcon(Component c, Graphics gr, int x, int y)
              {
                  Graphics2D g = (Graphics2D)gr;
                  AffineTransform oldAT = g.getTransform();
                  g.translate(x,y);
                  g.setColor(color);
                  g.fill(shape);
                  g.setTransform(oldAT);
              }
  
              @Override
              public int getIconWidth()
              {
                  return width;
              }
  
              @Override
              public int getIconHeight()
              {
                  return height;
              }
          };        
      }
docs: Create an Icon for the given sort order and priority. The priority
  is assumed to be in [0,3]
  
  @param sortOrder The sort order
  @param sortPriority The sort priority
  @return The icon