Article View: borland.public.jbuilder.java.swing
Article #11027JTable Resize Problems
From: Bob Pfingsten
Date: Mon, 19 Jul 1999 00:00
Date: Mon, 19 Jul 1999 00:00
28 lines
1877 bytes
1877 bytes
Hi all,
I have a jtable which is being placed inside of a jscrollpane which in turn
is dropped on a jpanel. I am using jBuilder 3 and jdk1.2. My problem is
that the table does not seem to be sizing itself correctly. That is it is
too big and the last column is extending of the edge of the scrollpane. In
my class I have extended jframe then simply add my scrollpane which was
instantiated with the table as a parameter. Accroding to sun this is a
known problem, but the only solution they had was to manually resize the
table( really.....not very professional). Does anyone have a better
workaround. I can post the rest of my code, but below is where I initialize
everything. Thanks in advance.
table.setGridColor(((GridColor!=null)?GridColor:Color.black));
table.setForeground(((Foreground!=null)?Foreground:Color.white));
table.setBackground(((Background!=null)?Background:Color.cyan));
table.setSelectionBackground(((SelectionBackground!=null)?SelectionBackgroun
d:Color.cyan.brighter()));
table.setSelectionForeground(((SelectionForeground!=null)?SelectionForegroun
d:Color.black));
table.setRowSelectionAllowed(getRowSelectionAllowed());
table.setColumnSelectionAllowed(getColumnSelectionAllowed());
scrollPane = new
JScrollPane(table);//table.createScrollPaneForTable(table);
this.add(scrollPane);
this.paintAll(this.getGraphics());
Technical Details
Message-ID:
<7n0m8r$g4l23@forums.borland.com>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,d2d08ffa4d28a382,start X-Google-Attributes: gid111d45,public From: "Bob Pfingsten" <bobp@dev-tech.com> Subject: JTable Resize Problems Date: 1999/07/19 Message-ID: <7n0m8r$g4l23@forums.borland.com> X-Deja-AN: 502961932 Organization: Another Netscape Collabra Server User X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Newsgroups: borland.public.jbuilder.java.swing