List of usage examples for javax.swing.tree TreeSelectionModel CONTIGUOUS_TREE_SELECTION
int CONTIGUOUS_TREE_SELECTION
To view the source code for javax.swing.tree TreeSelectionModel CONTIGUOUS_TREE_SELECTION.
Click Source Link
From source file:TreeSelectionOption.java
public static void main(String[] argv) { JTree tree = new JTree(); tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); tree.getSelectionModel().setSelectionMode(TreeSelectionModel.CONTIGUOUS_TREE_SELECTION); tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(new JScrollPane(tree)); frame.setSize(380, 320);/*from w w w. j a v a 2 s .c om*/ frame.setLocationRelativeTo(null); frame.setVisible(true); }