Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #3235 > unrolled thread

correct behavior of a cus

Started by"Ender" <ender@THRWHITE.remove-dii-this>
First post2011-04-27 15:43 +0000
Last post2011-04-27 15:43 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.lang.java.gui


Contents

  correct behavior of a cus "Ender" <ender@THRWHITE.remove-dii-this> - 2011-04-27 15:43 +0000
    Re: correct behavior of a "tar" <tar@THRWHITE.remove-dii-this> - 2011-04-27 15:43 +0000

#3235 — correct behavior of a cus

From"Ender" <ender@THRWHITE.remove-dii-this>
Date2011-04-27 15:43 +0000
Subjectcorrect behavior of a cus
Message-ID<2008030615405975249-noreply@mailinvalid>
  To: comp.lang.java.gui
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?

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [next] | [standalone]


#3236 — Re: correct behavior of a

From"tar" <tar@THRWHITE.remove-dii-this>
Date2011-04-27 15:43 +0000
SubjectRe: correct behavior of a
Message-ID<ymir6enh229.fsf@blackcat.isi.edu>
In reply to#3235
  To: comp.lang.java.gui
Ender <noreply@mail.invalid> writes:

> 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?

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.


-- 
Thomas A. Russ,  USC/Information Sciences Institute

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.gui


csiph-web