Set the Tree Line
import java.awt.BorderLayout; import java.awt.Color; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTree; import javax.swing.UIManager; public class TreeLineSample { public static void main(String args[]) { String title = "JTree Sample"; JFrame frame = new JFrame(title); UIManager.put("Tree.line", Color.green); JTree tree = new JTree(); tree.putClientProperty("JTree.lineStyle", "Horizontal"); tree.setSelectionModel(null); JScrollPane scrollPane = new JScrollPane(tree); frame.getContentPane().add(scrollPane, BorderLayout.CENTER); frame.setSize(300, 150); frame.setVisible(true); } }