Example usage for javax.swing.tree TreeSelectionModel addTreeSelectionListener

List of usage examples for javax.swing.tree TreeSelectionModel addTreeSelectionListener

Introduction

In this page you can find the example usage for javax.swing.tree TreeSelectionModel addTreeSelectionListener.

Prototype

void addTreeSelectionListener(TreeSelectionListener x);

Source Link

Document

Adds x to the list of listeners that are notified each time the set of selected TreePaths changes.

Usage

From source file:net.sourceforge.pmd.util.designer.Designer.java

private JComponent createASTPanel() {
    astTreeWidget.setCellRenderer(createNoImageTreeCellRenderer());
    TreeSelectionModel model = astTreeWidget.getSelectionModel();
    model.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    model.addTreeSelectionListener(new SymbolTableListener());
    model.addTreeSelectionListener(new CodeHighlightListener());
    return new JScrollPane(astTreeWidget);
}