🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

JTable column resize problem

#13168
From: Tapio Holopainen
Date: Wed, 16 Sep 1998 00:00
21 lines
1048 bytes
I'm using JTable with option:

_table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

Table is added to JScrollPane.

I wan't to set table columns width every time when table is resized. In
doLayout-method I put the new width for column by using
setPreferredWidth-method. 

_table.getColumnModel().getColumn(0).setPreferredWidth(width);

Problem: 

Which is the right method to find out JTables visible width and does
this method work with or without JScrollPane's horizontal and vertical
scrollbars?

Thanks in advance,

- Tapio
Technical Details
Message-ID: <35FFB0D4.CB236DF1@sysline.com>
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,b057b9324a39dfe3,start
X-Google-Attributes: gid111d45,public
From: Tapio Holopainen <tapio.holopainen@sysline.com>
Subject: JTable column resize problem
Date: 1998/09/16
Message-ID: <35FFB0D4.CB236DF1@sysline.com>
X-Deja-AN: 391690301
Content-Transfer-Encoding: 7bit
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: Sysline Oy
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing