FileDocCategorySizeDatePackage
JTreeASTPanel.javaAPI DocGlassfish v2 API963Wed Aug 30 15:34:16 BST 2006persistence.antlr.debug.misc

JTreeASTPanel

public class JTreeASTPanel extends JPanel

Fields Summary
JTree
tree
Constructors Summary
public JTreeASTPanel(TreeModel tm, TreeSelectionListener listener)

        // use a layout that will stretch tree to panel size
        setLayout(new BorderLayout());

        // Create tree
        tree = new JTree(tm);

        // Change line style
        tree.putClientProperty("JTree.lineStyle", "Angled");

        // Add TreeSelectionListener
        if (listener != null)
            tree.addTreeSelectionListener(listener);

        // Put tree in a scrollable pane's viewport
        JScrollPane sp = new JScrollPane();
        sp.getViewport().add(tree);

        add(sp, BorderLayout.CENTER);
    
Methods Summary