protected void paintNonLeaf(Graphics g, int x, int y, JTree tree, Object nonLeaf)
private void paintNonLeaf(Graphics g, int x, int y, JTree tree, Object nonLeaf) { TreePath tp = new TreePath(((DefaultMutableTreeNode) nonLeaf).getPath()); boolean selected = tree.isPathSelected(tp);  if (selected) { Component comp = tree.getCellRenderer() .getTreeCellRendererComponent(tree, nonLeaf, true, false, true, 0, false); rendererPane.paintComponent(g, comp, tree, getCellBounds(x, y, nonLeaf)); } else
  protected void paintNonLeaf(Graphics g, int x, int y, JTree tree, Object nonLeaf)  {    Component c = tree.getCellRenderer().getTreeCellRendererComponent(tree,                                                                       nonLeaf,                                                                       false, // selected                                                                      false, // expanded                                                                      false, // leaf                                                                      0,     // row                                                                      false  // hasFocus                                                                      );    g.translate(x, y);    c.paint(g);    g.translate(-x, -y);  }