Article View: borland.public.jbuilder.java.swing
Article #8125JTable and scrollpane
From: ross
Date: Fri, 03 Nov 2000 00:00
Date: Fri, 03 Nov 2000 00:00
25 lines
1341 bytes
1341 bytes
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:
<3a03427f$1_1@dnews>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,a8dcf0d47c78cd3b,start X-Google-Attributes: gid111d45,public From: "ross" <rperry@commonvision.com> Subject: JTable and scrollpane Date: 2000/11/03 Message-ID: <3a03427f$1_1@dnews> X-Deja-AN: 689410804 X-Trace: 3 Nov 2000 14:55:59 -0800, 216.202.63.17 Organization: cv Newsgroups: borland.public.jbuilder.java.swing X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4