Article View: borland.public.jbuilder.java.swing
Article #11049Re: JTable Resize Problems
From: CV
Date: Wed, 21 Jul 1999 00:00
Date: Wed, 21 Jul 1999 00:00
38 lines
2162 bytes
2162 bytes
Have you tried the following methods?
JTable.repaint()
JTable.revalidate()
-CV
Bob Pfingsten wrote:
> 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:
<379614E4.CB1283B2@guest.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7n0m8r$g4l23@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,d2d08ffa4d28a382 X-Google-Attributes: gid111d45,public From: CV <guest@guest.com> Subject: Re: JTable Resize Problems Date: 1999/07/21 Message-ID: <379614E4.CB1283B2@guest.com> X-Deja-AN: 503634501 Content-Transfer-Encoding: 7bit References: <7n0m8r$g4l23@forums.borland.com> To: Bob Pfingsten <bobp@dev-tech.com> Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing