🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Can a Double object passed to a JTable directly edit a double primitive in another Class?

#8180
From: Zachary Cooper
Date: Wed, 11 Oct 2000 00:00
25 lines
1449 bytes
I have a Data Class like the following:

public class Data {
int index;
double x;
String name;
}

I want to create a Vector or Array of these objects, and then edit the
primitive values it contains directly in a JTable.  It there any way to
easily do this?

So far I've been using an extension of the DefaultTableModel to create
Objects out of the primitives in the Data Class and pass them to the JTable.
Then when the JTable changes, I use JTable.getDataVector() and have
a 'translate' method that maps the Object from the JTable to the respective
primitive.  It's actually pretty fast, but it makes changes to the table
format
onerous and seems unnecessary.

In short, can a Double object passed to a JTable directly edit a double
primitive in another Class file that was used to create the Double object
to begin with?

Thanks.
Technical Details
Message-ID: <39e4c595$1_1@dnews>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,ba69744872802910,start
X-Google-Attributes: gid111d45,public
From: "Zachary Cooper" <ztc@bigfoot.com>
Subject: Can a Double object passed to a JTable directly edit a double primitive in another Class?
Date: 2000/10/11
Message-ID: <39e4c595$1_1@dnews>
X-Deja-AN: 680285358
X-Trace: 11 Oct 2000 12:55:01 -0800, 151.202.98.238
X-MSMail-Priority: Normal
X-Priority: 3
Reply-To: "Zachary Cooper" <ztc@bigfoot.com>
Newsgroups: borland.public.jbuilder.java.swing
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400