🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

JTable wierdness!

#7915
From: Greg Tomalesky
Date: Mon, 27 Nov 2000 00:00
30 lines
1679 bytes
Hi Folks:

    I am developing an application which allows the user to add and
remove columns in a JTable. Getting the visuals to work was easy
(addColumn/removeColumn). The wierdness happens when I try to save the
underlying vector (from getDataVector()). It seems that even though I
have removed the columns, they return just in time to be saved to a
file(ObjectOutputStream) so that when I re-load the data vector
(setDataVector), the "deleted" columns re-appear!!! Additional wierdness
occurs when I examine the above vector. If I use the following code to
print the contents of the vector:

    vec = myTableModel.getDataVector();
    System.out.println(vec.toString()+"<"+vec.size()+">");

I get the following results

[[sis2.CellProperties@36d9d8, sis2.CellProperties@1827d1]]<1>

the size is correct after a column deletion but the vector still
contains the references to the contents!

    The underlying TableCoumnModel properly shows that the column in
question has removed!

    What am I doing wrong or is this a known bug??? I have RH6.1 Linux
and this problem occurs with both 1.2.2 and 1.3.0 both from Sun.

Thanks for your help
Greg
Technical Details
Message-ID: <3A232C5A.5EC55C33@nfdc.net>
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,ce6d2d700b1f0f47,start
X-Google-Attributes: gid111d45,public
From: Greg Tomalesky <delta4@nfdc.net>
Subject: JTable wierdness!
Date: 2000/11/27
Message-ID: <3A232C5A.5EC55C33@nfdc.net>
X-Deja-AN: 698510491
Content-Transfer-Encoding: 7bit
Organization: Another Netscape Collabra Server User
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing