Module java.desktop

Class MetalTreeUI

java.lang.Object

public class MetalTreeUI extends BasicTreeUI
The metal look and feel implementation of TreeUI.

MetalTreeUI allows for configuring how to visually render the spacing and delineation between nodes. The following hints are supported:

Descriptions of supported hints: Angled, Horizontal, and None
Hint Description
Angled A line is drawn connecting the child to the parent. For handling of the root node refer to JTree.setRootVisible(boolean) and JTree.setShowsRootHandles(boolean).
Horizontal A horizontal line is drawn dividing the children of the root node.
None Do not draw any visual indication between nodes.

As it is typically impractical to obtain the TreeUI from the JTree and cast to an instance of MetalTreeUI you enable this property via the client property JTree.lineStyle. For example, to switch to Horizontal style you would do: tree.putClientProperty("JTree.lineStyle", "Horizontal");

The default is Angled.