edit a node in jtree

how do i edit a node in Jtree. im using a pop up menuWhen i click on the node (RT CLICK) and click on edit in the menu..any code referencescheers
[180 byte] By [Myquery] at [2007-9-26 2:06:51]
# 1

U do something similar to this:

DefaultTreeCellEditor celleditor = new CellEditor(tree,new DefaultTreeCellRenderer());

celleditor.addCellEditorListener(new CellEditorListener());

tree.setCellEditor(celleditor);

tree.setEditable(true);

and when the user rightclicks and choose edit u do a:

tree.startEditingAtPath(treepath);

And u should create and listener extending CellEditorListener, and fill in what u want in the methods:

public void editingCanceled(ChangeEvent e) {}

public void editingStopped(ChangeEvent e) {}

Stig.

slackman at 2007-6-29 8:53:29 > top of Java-index,Archived Forums,Swing...
# 2
it helps .... but could u be more specficthanks
Myquery at 2007-6-29 8:53:29 > top of Java-index,Archived Forums,Swing...