🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: JTable and scrollpane

#8130
From: eric moon
Date: Fri, 03 Nov 2000 00:00
43 lines
1788 bytes
I've always had to call setMaximum and setMinimum if I wanted a component
not to resize, even in a scrollpane.  Although it sounds like there's a
better way now.

HTH

eric moon
and dog temiqui
boulder, co


"ross" <rperry@commonvision.com> wrote in message news:3a03427f$1_1@dnews...
> I have a JTable in a JScrollPane and just cant get any scrollbars to
> show.  No matter how wide I make the table columns when the frame shows
all
> of the columns are shown squished together with no scrollbars.  I have
both
> scrollbars set to as needed.
> I call this method as the last call in jbInit
>
>     private void initColumnSizes() {
>         TableColumn column = null;
>         Component comp = null;
>         int width = 0;
>         int colCount = m_tblModel.getColumnCount();
>         for (int i=0; i<colCount; i++) {
>             column = m_tbl.getColumnModel().getColumn(i);
>             width = ViewerResource.TABLE_COLUMN_WIDTHS[i];
>
>             column.setPreferredWidth(width);
>         }
>     }
>
> Do I have to have data in the model before this works??
> I never had any problems before using jdk 1.2 but this time I
> am using jdk 1.3.  What am I doing wrong?
>
> thanks
> Ross
>
>
>
>
Technical Details
Message-ID: <3a039b81$1@news.webaccess.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3a03427f$1_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,a8dcf0d47c78cd3b
X-Google-Attributes: gid111d45,public
From: "eric moon" <woodslanding@yahoo.com>
Subject: Re: JTable and scrollpane
Date: 2000/11/03
Message-ID: <3a039b81$1@news.webaccess.net>
X-Deja-AN: 689500023
References: <3a03427f$1_1@dnews>
X-Trace: 3 Nov 2000 22:15:45 -0700, s172-230.denver.webaccess.net
X-MSMail-Priority: Normal
X-Priority: 3
Newsgroups: borland.public.jbuilder.java.swing
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700