🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #7728

Re: table changes

#7728
From: John McGrath TeamB
Date: Fri, 05 Jan 2001 09:37
37 lines
2328 bytes
On Wed, 3 Jan 2001 10:22:13 -0500, Tom Denn wrote:

> Can I ask, if my TableCellEditor is say a JPanel with
> some other text component, which focusLost method would
> I override? Would it be the JPanel's?  I don't see
> focusLost() in the JPanel's hierarchy.

Sorry - I should have said the processFocusEvent() method.  You would 
need to check to see whether the event type was FOCUS_LOST.  You might 
also be able to accomplish the same thing by adding a FocusListener and 
using the focusLost() method of the listener.

I spent a lot of time mucking with this code, and eventually came up 
with something that works pretty well.  But that was a while ago and it 
was far from a straight path to get there, so I am a little fuzzy on 
it.

> I don't see how these would help me when say my editor
> object is a button and a JdbTextField in a JPanel.

If your TableCellEditor is a compound component, then I imagine it will 
get more complicated, since each of the components in your editor will 
be losing focus as the focus shifts within the editor.

I am not sure how to deal with that situation, but one thing I would 
look into would be the isManagingFocus() method.  It also might be a 
good idea to take a look at a JComboBox, since it is a compound 
component, and may face similar issues.

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <MPG.14bf498e6f16f0c989e3d@forums.borland.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!news.cs.utwente.nl!newsgate.cistron.nl!newsfeeds.belnet.be!naxos.belnet.be!news.belnet.be!bornews.borland.com!not-for-mail
References: <3a40e369_1@dnews> <MPG.14ab42f0745af8c5989de5@forums.borland.com> <3a5342f4_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,a038583ae354cf02
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2001-01-05 01:43:20 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!news.cs.utwente.nl!newsgate.cistron.nl!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: table changes
Date: Fri, 5 Jan 2001 04:37:18 -0500
Organization: Another Netscape Collabra Server User
Lines: 37
Message-ID: <MPG.14bf498e6f16f0c989e3d@forums.borland.com>
References: <3a40e369_1@dnews> <MPG.14ab42f0745af8c5989de5@forums.borland.com> <3a5342f4_1@dnews>
NNTP-Posting-Host: dslcv1-60.fast.net
X-Newsreader: MicroPlanet Gravity v2.30