🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

DefaultTableModel.addRow(Vector/Object[]) throws exceptions when rendering...

#8093
From: Zachary Cooper
Date: Mon, 23 Oct 2000 00:00
23 lines
1345 bytes
I have an empty JTable I'm adding columns to and then rawData to.
I'm using the following code:

JTable table = new JTable();
table.addColumn(aColumn);
table.addColumn(bColumn);
// the columns are already defined, and if I run the project at this point,
// a table with 2 columns appears with no data.
// next, I try to add row data using the following code:
DefaultTableModel model = (DefaultTableModel)table.getModel();

Vector data = new Vector();
data.add(new Double(1.0));
data.add(new Double(2.0));
model.addRow(data);

// OR

Object[] rowData = {new Double(1.0), new Double(2.0)};
model.addRow(rowData);

// both attempts throw a series of exceptions..  after adding the
// rows, the table show the correct rowCount()... any suggestions?
Technical Details
Message-ID: <39f489de_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,1c322693e68167c,start
X-Google-Attributes: gid111d45,public
From: "Zachary Cooper" <ztc@bigfoot.com>
Subject: DefaultTableModel.addRow(Vector/Object[]) throws exceptions when rendering...
Date: 2000/10/23
Message-ID: <39f489de_1@dnews>
X-Deja-AN: 684925052
X-Trace: 23 Oct 2000 11:56:30 -0800, 151.202.99.184
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