TreePath treePath = null; for (String prefix : paths) { treePath = tree.getNextMatch( prefix, row, Position.Bias.Forward ); row = tree.getRowForPath(treePath);
private void expandPath( final String name ) { final TreePath tp = getJTree().getNextMatch( name, 0, Position.Bias.Forward ); if ( tp != null ) { getJTree().expandPath( tp ); } }
private void collapsePath( final String name ) { final TreePath tp = getJTree().getNextMatch( name, 0, Position.Bias.Forward ); if ( tp != null ) { getJTree().collapsePath( tp ); } }
TreePath path = tree.getNextMatch(prefix, startRow, Position.Bias.Forward); MutableTreeNode node = (MutableTreeNode) path.getLastPathComponent();
for (String part : parts) { int row = (path==null ? 0 : tree.getRowForPath(path)); path = tree.getNextMatch(part, row, Position.Bias.Forward); if (path==null) { return false;
tree1.setCellRenderer(new SwitchTreeIcons(true)); tree1.setEditable(true); tree1.expandPath(tree1.getNextMatch("colors", 0, Position.Bias.Forward)); tree1.expandPath(tree1.getNextMatch("food", 0, Position.Bias.Forward)); tree1.setVisibleRowCount(10); sp1 = new JScrollPane(tree1); root.setUserObject("JTree disabled"); tree2.getModel().valueForPathChanged(new TreePath(root.getPath()), "JTree disabled"); tree2.expandPath(tree2.getNextMatch("sports", 0, Position.Bias.Forward)); tree2.setEnabled(false); tree2.setVisibleRowCount(10);
TreePath treePath = null; for (String prefix : paths) { treePath = tree.getNextMatch( prefix, row, Position.Bias.Forward ); row = tree.getRowForPath(treePath);