🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: displaying dates in JTable cells

#1417
From: John McGrath [TeamB]
Date: Sat, 08 Nov 2003 09:41
28 lines
1907 bytes
On 10/28/2003 at 4:43:13 PM, George wrote:

> I am trying to display a result set from an Oracle database in a
> JTable.  The isCellEditable() method returns true for all cells in
> this table.
> 
> I find that the cells are editable if the column type in the database
> is varchar2 and number data types,  If the column type is
> java.sql.Date, the cell is not editable.
>  If however I create java.util.Date objects within the program, the
> table cells are editable for these objects.
> 
> Why is this so?  

The default editor lookup mechanism requires an exact match on the
class - it will not find an editor for a subclass.  What you need to do
is to define the default editor for the java.sql.Date class.  I think
you should be able to get the default editor for the java.util.Date
class and use that.

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <3facc861@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3f9ee2d3$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,9b0336469e18d8d9
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2003-11-08 02:54:17 PST
From: "John McGrath  [TeamB]" <ng-b@JPMcGrath.net>
Subject: Re: displaying dates in JTable cells
Newsgroups: borland.public.jbuilder.java.swing
References: <3f9ee2d3$1@newsgroups.borland.com>
User-Agent: XanaNews/1.15.7.4
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
NNTP-Posting-Host: 141.158.61.20
Message-ID: <3facc861@newsgroups.borland.com>
Date: 8 Nov 2003 02:41:37 -0700
X-Trace: newsgroups.borland.com 1068288097 141.158.61.20 (8 Nov 2003 02:41:37 -0700)
Lines: 28
X-Authenticated-User: jpmcgrath
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail