Article View: borland.public.jbuilder.java.swing
Article #7730Re: Focus on a table cell
From: John McGrath TeamB
Date: Fri, 05 Jan 2001 09:37
Date: Fri, 05 Jan 2001 09:37
37 lines
2405 bytes
2405 bytes
On Wed, 3 Jan 2001 10:48:03 -0500, Tom Denn wrote:
> You said in an earlier post "table changes" concerning when
> to call stopCellEditing() on an editor.....
>
> Now, your suggestion here to add listeners to the row and
> column selection models to detect the focus changes sounds
> like I would be creating some sort of TableFocusManager
> that's registered as a focusListener to these models.
Although they are rendered in a very similar fashion, I think that the
focused cell in a JTable is something very different from the focused
component. The JTable manages which cell "has focus" and the focus
manager keeps track of which component has focus.
> This manager would then call the currently active
> TableCellEditor's stopCellEditing() method when it
> detected that the focus was lost?
That would not handle the case when you are editing a cell and then
click on some component other than the JTable. In that case, the
focused cell would not change, although I think you want to stop cell
editing at this point.
As I recall, the only way I was able to handle was by detecting the
shift of focus away from the TableCellEditor component. But I am going
to have to dig out that code to be sure that is how I handled it.
Unfortunately, I do not have access to that code right now.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<MPG.14bf4f0cb07f819f989e3e@forums.borland.com>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!news.cs.utwente.nl!logbridge.uoregon.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!newsfeeds.belnet.be!naxos.belnet.be!news.belnet.be!bornews.borland.com!not-for-mailReferences:
<3a41e1cd_2@dnews> <MPG.14b498899ac43a53989def@forums.borland.com> <3a534901_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,8c847dc85cebe1dc X-Google-Attributes: gid111d45,public X-Google-ArrivalTime: 2001-01-05 01:43:30 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!news.cs.utwente.nl!logbridge.uoregon.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!newsfeeds.belnet.be!naxos.belnet.be!news.belnet.be!bornews.borland.com!not-for-mail From: John McGrath [TeamB] <ng-b@JPMcGrath.net> Newsgroups: borland.public.jbuilder.java.swing Subject: Re: Focus on a table cell Date: Fri, 5 Jan 2001 04:37:18 -0500 Organization: Another Netscape Collabra Server User Lines: 37 Message-ID: <MPG.14bf4f0cb07f819f989e3e@forums.borland.com> References: <3a41e1cd_2@dnews> <MPG.14b498899ac43a53989def@forums.borland.com> <3a534901_1@dnews> NNTP-Posting-Host: dslcv1-60.fast.net X-Newsreader: MicroPlanet Gravity v2.30