public static void paintComponent(
     final Graphics graphics,
     final Component component,
     final Container container,
     final Rectangle rect) {
   paintComponent(graphics, component, container, rect.x, rect.y, rect.width, rect.height);
 }
 public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
   Insets borderInsets = border.getBorderInsets(c);
   Insets insets = getBorderInsets(c);
   int temp = (insets.top - borderInsets.top) / 2;
   border.paintBorder(c, g, x, y + temp, width, height - temp);
   Dimension size = comp.getPreferredSize();
   rect = new Rectangle(offset, 0, size.width, size.height);
   SwingUtilities.paintComponent(g, comp, (Container) c, rect);
 }
 public void drawDraggedComponent(Component dragIcon, int x, int y) {
   Dimension size = dragIcon.getPreferredSize();
   treePanel.paintImmediately(
       previousDragXLocation, previousDragYLocation, size.width, size.height);
   this.getLayeredPane().setLayer(dragIcon, 400);
   SwingUtilities.paintComponent(
       treePanel.getGraphics(), dragIcon, treePanel, x, y, size.width, size.height);
   previousDragXLocation = x;
   previousDragYLocation = y;
 }
 @Override
 public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
   Insets borderInsets = border.getBorderInsets(c);
   Insets insets = getBorderInsets(c);
   int temp = (insets.top - borderInsets.top) / 2;
   border.paintBorder(c, g, x, y + temp, width, height - temp);
   g.setColor(comp.getBackground());
   g.fillRect(rect.x - 1, rect.y, rect.width + 2, rect.height);
   SwingUtilities.paintComponent(g, comp, intermediate, rect);
 }
 @Override
 public void paintIcon(Component c, Graphics g, int x, int y) {
   SwingUtilities.paintComponent(g, check, (Container) c, x, y, getIconWidth(), getIconHeight());
 }