🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: table changes

#7679
From: John McGrath TeamB
Date: Wed, 27 Dec 2000 06:11
25 lines
1692 bytes
On Wed, 20 Dec 2000 16:52:47 -0000, Marty wrote:

> Ive got a table and associated table model.... my problem is
> that the the model is only updated if i hit the <return> key
> after making changes.... ie... if i tab out or mouseclick to
> another cell, my update is lost... its still on the screen,
> but not in the table model

The problem is that your TableCellEditor is still active.  Calling 
stopCellEditing() on the TableCellEditor will terminate the editor, 
which will cause your TableModel to be updated.

Of course, the problem is knowing when to do this.  I wrestled with 
this for a while, and eventually came up with a solution I was happy 
with.  I believe what I did was to override the focusLost() method for 
the TableCellEditor and call it from there.

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <MPG.14ab42f0745af8c5989de5@forums.borland.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!isdnet!newsfeeds.belnet.be!naxos.belnet.be!news.belnet.be!bornews.borland.com!not-for-mail
References: <3a40e369_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: 2000-12-26 22:09:58 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!isdnet!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: Wed, 27 Dec 2000 01:11:10 -0500
Organization: Another Netscape Collabra Server User
Lines: 25
Message-ID: <MPG.14ab42f0745af8c5989de5@forums.borland.com>
References: <3a40e369_1@dnews>
NNTP-Posting-Host: dslcv1-60.fast.net
X-Newsreader: MicroPlanet Gravity v2.30