Article View: borland.public.jbuilder.java.swing
Article #10179Re: JTable again!
From: Johan Forsberg
Date: Thu, 04 Nov 1999 00:00
Date: Thu, 04 Nov 1999 00:00
18 lines
1178 bytes
1178 bytes
Alexandre Reis <areis@mitra.com> skrev i
diskussionsgruppsmeddelandet:38203E71.817D181C@mitra.com...
> My question is: Is there a way to hide the columns from a JTable at
> runtime?
TableColumn tc=table.getColumn("Title");
TableColumnModel tcm=table.getColumnModel();
tcm.removeColumn(tc);
...
tcm.addColumn(tc);
addColumn will reinsert the removed column, but furthest to
the right, so you might want to follow it up with a tcm.moveColumn().
An even better solution might be to store all the original TableColumns
in a array or Vector, that way you can rebuild the TableColumnModel any
way you want to at any time.
Technical Details
Message-ID:
<7vs6mo$3au14@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<38203E71.817D181C@mitra.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,4e01de35b63f3e2d X-Google-Attributes: gid111d45,public From: "Johan Forsberg" <jfo@SPAM_SPAM_EGGS_SPAMstmf.se> Subject: Re: JTable again! Date: 1999/11/04 Message-ID: <7vs6mo$3au14@forums.borland.com> X-Deja-AN: 544407953 References: <38203E71.817D181C@mitra.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.swing