🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: select cell for editing in JTable

#8152
From: John McGrath TeamB
Date: Wed, 18 Oct 2000 00:00
22 lines
1226 bytes
On Mon, 16 Oct 2000 12:54:33 -0400, Zachary Cooper wrote:

> I want to make cells in my table ready to edit after 1 click
> (upon selection).  I adjusted setClickCountsToStart(), but
> that doesn't highlight the content for an overwrite... is
> there an wasy way to have the value highlighted for an
> overwrite upon selection of the cell?

Not an easy way.

In order to do this, you need to create your own TableCellEditor.  The 
component that it returns needs to listen for a FocusGained event, and 
use SwingUtilities.invokeLater() to do a deferred  selectAll().

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <MPG.14570ee35f6c0b73989c2c@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <39eb305b$1_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,9ace63fd1da63330
X-Google-Attributes: gid111d45,public
From: John McGrath  [TeamB] <ng-b@JPMcGrath.net>
Subject: Re: select cell for editing in JTable
Date: 2000/10/18
Message-ID: <MPG.14570ee35f6c0b73989c2c@forums.borland.com>
X-Deja-AN: 682762236
References: <39eb305b$1_1@dnews>
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.swing