🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

cannot set column width of table inside scrollpane

#11611
From: jsr1
Date: Tue, 27 Apr 1999 00:00
31 lines
1675 bytes
If I have a jdbTable with TableHeader on an applet window I can set
column properties using

      tabcolmod2 = jdbTable2.getColumnModel();
      tabcolmod2.getColumn(0).setHeaderValue("Code 4");
      tabcolmod2.getColumn(1).setWidth(30);
      tabcolmod2.getColumn(1).setHeaderValue("Title 4");
      tabcolmod2.getColumn(1).setWidth(200);

but if they are inside a JScrollPane, set up with

    jScrollPane1 = jdbTable1.createScrollPaneForTable(jdbTable1);

and apply the code

      tabcolmod1 = jdbTable1.getColumnModel();
      tabcolmod1.getColumn(0).setHeaderValue("Code 5");
      tabcolmod1.getColumn(1).setWidth(30);
      tabcolmod1.getColumn(1).setHeaderValue("Title 5");
      tabcolmod1.getColumn(1).setWidth(200);

then the column heading text appears as I wish, but the width settings
are ignored.

Any suggestions ?  Thanks!

-- 
John S Robinson                              Tel:   +44-1904-433833
University of York Computing Service         Fax:   +44-1904-433740
Heslington, YORK.  YO10 5DD                  email: jsr1@york.ac.uk
http://www.york.ac.uk/~jsr1  -  but I wouldn't bother if I were you
Technical Details
Message-ID: <3725D300.694B124F@york.ac.uk>
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,5e93a15f0ec83a3d,start
X-Google-Attributes: gid111d45,public
From: jsr1 <jsr1@york.ac.uk>
Subject: cannot set column width of table inside scrollpane
Date: 1999/04/27
Message-ID: <3725D300.694B124F@york.ac.uk>
X-Deja-AN: 471491876
Content-Transfer-Encoding: 7bit
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing