Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / March 2008

Tip: Looking for answers? Try searching our database.

correct behavior of a custom cell renderer editing

Thread view: 
Ender - 06 Mar 2008 21:40 GMT
In a JTree I have several leaf nodes w/ a custom renderer extended from
DefaultTreeCellRenderer. Some of the leaf nodes are JComboBoxes and
others are JTextFields. When  user clicks on the leaf node to edit, for
ex. a JTextField ... he inputs the text while the field is in edit mode.

At this point, what if he doesn't press the enter key to stop it from
editing ... what if the user just enters the text, there's still a
blinking cursor, then takes the mouse to click on another leaf node ...
which means the tree model's listener treeNodesChanged() never gets
fired.

What am I supposed to do in that case? Should I manually fire this
change somehow? Anyone know how?
Thomas A. Russ - 06 Mar 2008 23:20 GMT
> In a JTree I have several leaf nodes w/ a custom renderer extended from
> DefaultTreeCellRenderer. Some of the leaf nodes are JComboBoxes and
[quoted text clipped - 9 lines]
> What am I supposed to do in that case? Should I manually fire this
> change somehow? Anyone know how?

I suppose you need to do this using a FocusLost listener.

It really is a pain that these minor nits can't be handled by the
default renderer already.  I suppose that is the price you pay for being
able to use general purpose editing components.

Signature

Thomas A. Russ,  USC/Information Sciences Institute



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.