Skip to content

TreeCellEditor

Make only the leaf nodes in JTree editable.

Section titled “Make only the leaf nodes in JTree editable.”
Make only the leaf nodes in JTree editable.

LeafTreeCellEditor

This configures JTree so that node label editing is only possible for leaf nodes.

Restrict JTree node editing to JPopupMenu only.

Section titled “Restrict JTree node editing to JPopupMenu only.”
Restrict JTree node editing to JPopupMenu only.

StartEditingPopupMenu

This restricts JTree node editing to only via JPopupMenu, rather than mouse clicks.

Convert JTree leaf nodes to JCheckBoxes

CheckBoxNodeTree

This will make the leaf nodes of a JTree editable JCheckBoxes.

Display directory structure with JTree with JCheckBox

Section titled “Display directory structure with JTree with JCheckBox”
Display directory structure with JTree with JCheckBox

FileSystemTreeWithCheckBox

This displays the directory structure using a JTree with editable JCheckBoxes added to the nodes.

Add a JCheckBox to all nodes in the JTree.

Section titled “Add a JCheckBox to all nodes in the JTree.”
Add a JCheckBox to all nodes in the JTree.

CheckBoxNodeEditor

Add an editable JCheckBox to every node in the JTree.

Use JCheckBox in JList cells

CheckBoxCellList

Use JCheckBox in a JList cell to create a list of checkboxes.

Committed JTree node editing.

InvokesStopCellEditing

This setting determines whether changes are automatically saved if an interruption occurs while editing a JTree node.

Use JPanel, which contains JComboBox and other elements, in the JTree cell editor.

Section titled “Use JPanel, which contains JComboBox and other elements, in the JTree cell editor.”
Use JPanel, which contains JComboBox and other elements, in the JTree cell editor.

ComboBoxCellEditor

We will use JPanel, which contains JComboBox and other elements, as the cell editor and cell renderer for JTree.

Change the icon displayed while editing a JTree node.

Section titled “Change the icon displayed while editing a JTree node.”
Change the icon displayed while editing a JTree node.

TreeCellEditorNodeIcon

This changes the node icon displayed when editing a JTree node begins.

Place multiple clickable JButtons on a JTree node.

Section titled “Place multiple clickable JButtons on a JTree node.”
Place multiple clickable JButtons on a JTree node.

MultipleButtonsInTreeNode

Set up a JPanel containing multiple clickable JButtons to serve as the cell editor for JTree.

Investigate whether a JTree TreeNode can be edited.

Section titled “Investigate whether a JTree TreeNode can be edited.”
Investigate whether a JTree TreeNode can be edited.

EditableTreePath

The JTree node editor determines whether it can start editing by obtaining its status from TreePath or MouseEvent.