g.setColor(UIManager.getColor("Tree.line")); Rectangle clip = g.getClipBounds(); int row0 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y)); int row1 = getRowForPath(tree, getClosestPathForLocation(tree, 0, clip.y + clip.height - 1)); if (row0 >= 0 && row1 >= 0) { for (int i = row0; i <= row1; i++) { TreePath p = getPathForRow(tree, i); if (p != null && p.getPathCount() == 2) { Rectangle r = getPathBounds(tree, getPathForRow(tree, i)); if (r != null) { g.drawLine(clip.x, r.y, clip.x + clip.width, r.y); } } } }
  protected void paintHorizontalSeparators(Graphics g, JComponent c)    throws NotImplementedException  {    // FIXME: not implemented  }