Article View: borland.public.jbuilder.java.swing
Article #1605Re: Table Model Listener Problem
From: John McGrath [TeamB]
Date: Tue, 16 Sep 2003 08:30
Date: Tue, 16 Sep 2003 08:30
28 lines
2163 bytes
2163 bytes
On 9/11/2003 at 10:04:32 AM, lee-ann wrote:
> The scenario I have is that in my GUI application if the user changes
> a value in a cell and then leaves that screen without either pressing
> return or clicking specifically on another cell, the tableEvent is
> not triggered and the user is not prompted to save changes. Should I
> instead use a cellEditor listener?
You need to force the cell editing to stop. You can get the cell
editor from the JTable and (if it is not null) call its
stopCellEditing() method.
I have dealt with this by modifying all of the cell editors to stop
editing when they lose focus. But this is tricky, since a JTable can
also use a cell editor by redirecting events to the editor. This is
not a simple problem to solve in general.
Probably the easiest way to deal with it is to force the cell editing
to stop when the user "leaves that screen".
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<3f66ca2f$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!diablo.theplanet.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f605b04@newsgroups.borland.com> <3f606bb4$1@newsgroups.borland.com> <3f607ca0$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,91f580c0d460848c X-Google-Attributes: gid111d45,public X-Google-ArrivalTime: 2003-09-16 01:44:06 PST From: "John McGrath [TeamB]" <ng-b@JPMcGrath.net> Subject: Re: Table Model Listener Problem Newsgroups: borland.public.jbuilder.java.swing References: <3f605b04@newsgroups.borland.com> <3f606bb4$1@newsgroups.borland.com> <3f607ca0$1@newsgroups.borland.com> User-Agent: XanaNews/1.15.6.3 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 NNTP-Posting-Host: 141.158.30.162 Message-ID: <3f66ca2f$1@newsgroups.borland.com> Date: 16 Sep 2003 01:30:39 -0700 X-Trace: newsgroups.borland.com 1063701039 141.158.30.162 (16 Sep 2003 01:30:39 -0700) Lines: 28 X-Authenticated-User: jpmcgrath Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!diablo.theplanet.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail