custom cell renderer stays in edit mode
| From:Jake [jake@masked-domain] |
| Sent on:6 May 2008 02:04:47 GMT |
Hi,
In a JTree I have several leaf nodes w/ a custom renderer extended from
an AbstractCellRenderer which implements a TreeCellEditor and a
CellEditorListener. Some of the leaf nodes are JComboBoxes, and others
are JTextFields.
When the user clicks on one of the JComboBox leaf nodes, the JComboBox
will drop down displaying it's list of menu items ready for selection.
My problem is that, when the user selects an item in the drop down list,
the JComboBox drop down list of items no longer appears (which is
normal), however, the JComboBox is still in edit mode as seen by the item
that is still highlighted and the icon is still showing an edit icon
(document icon) and not the icon I have on it when in a normal unediting
state.
It seems that while it's still in an editing state, the only way to
"punch in" the value is when the user clicks on another leaf node or
loses focus, then the leaf node apears as normal. I'm expecting that once
the selection is made from the list by clicking on an item, then it's no
longer being edited.
Anyone have ideas on this? Any help much appreciated.