Available Methods
- DropLocation ( )
- setCellRenderer ( )
- addTreeSelectionListener ( )
- getRowCount ( )
- setRootVisible ( )
- convertValueToText ( )
- getModel ( )
- expandPath ( )
- expandRow ( )
- getRowForPath ( )
- getPathForRow ( )
- addMouseListener ( )
- getSelectionPath ( )
- setShowsRootHandles ( )
- isLargeModel ( )
- getSelectionRows ( )
- setSelectionPath ( )
- isEnabled ( )
- getLastSelectedPathComponent ( )
- collapsePath ( )
- getRowForLocation ( )
- getDropLocation ( )
- getSelectionPaths ( )
- isExpanded ( )
- getRowHeight ( )
- putClientProperty ( )
- getCellRenderer ( )
- setDragEnabled ( )
- setRowHeight ( )
- setUI ( )
- setEditable ( )
- collapseRow ( )
- setModel ( )
- scrollPathToVisible ( )
- setSelectionRow ( )
- getRowBounds ( )
- setTransferHandler ( )
- setCellEditor ( )
- setSelectionPaths ( )
- isRootVisible ( )
- addTreeExpansionListener ( )
- setToolTipText ( )
- getSelectionModel ( )
- getSelectionCount ( )
- repaint ( )
Related Classes
- java.io.File
- java.awt.Color
- java.awt.event.ActionEvent
- java.awt.event.ActionListener
- javax.swing.JPanel
- java.awt.Dimension
- javax.swing.JFrame
- java.awt.Font
- java.awt.event.MouseEvent
- javax.swing.JLabel
- javax.swing.JButton
- java.awt.event.KeyEvent
- java.awt.BorderLayout
- javax.swing.JOptionPane
- java.awt.Component
- javax.swing.JScrollPane
- java.awt.Rectangle
- javax.swing.JTextField
- javax.swing.SwingUtilities
- java.awt.event.MouseAdapter
- javax.swing.ImageIcon
- java.awt.Point
- javax.swing.JComponent
- javax.swing.JCheckBox
- javax.swing.UIManager
Java Code Examples for javax.swing.JTree#getSelectionModel()
The following examples show how to use
javax.swing.JTree#getSelectionModel() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProcessingComponent.java From mzmine3 with GNU General Public License v2.0 | 5 votes |
private @Nullable DefaultMutableTreeNode getSelectedItem(@Nonnull JTree tree) { TreeSelectionModel selectionModel = tree.getSelectionModel(); if (selectionModel == null) return null; TreePath path = selectionModel.getSelectionPath(); if (path == null) return null; return (DefaultMutableTreeNode) path.getLastPathComponent(); }
Example 2
Source File: ProcessingComponent.java From mzmine2 with GNU General Public License v2.0 | 5 votes |
private @Nullable DefaultMutableTreeNode getSelectedItem(@Nonnull JTree tree) { TreeSelectionModel selectionModel = tree.getSelectionModel(); if (selectionModel == null) return null; TreePath path = selectionModel.getSelectionPath(); if (path == null) return null; return (DefaultMutableTreeNode) path.getLastPathComponent(); }
Example 3
Source File: AbstractTab.java From DiskBrowser with GNU General Public License v3.0 | 5 votes |
protected void setTree (JTree tree) // ---------------------------------------------------------------------------------// { this.tree = tree; tree.setFont (font); scrollPane.setViewportView (tree); TreeSelectionModel tsm = tree.getSelectionModel (); tsm.setSelectionMode (TreeSelectionModel.SINGLE_TREE_SELECTION); if (adapters.size () > 0) restoreAdapters (); else addTreeMouseListener (new CursorHandler ()); }