Re: automatically maximize JTable?





Andrew Thompson wrote:
> On 27 Jun 2005 06:59:10 -0700, matomira@xxxxxxx wrote:
>
> > I have a JTable inside a JScrollPanel in the CENTER of a Panel
>
> A Panel, or a JPanel?

JPanel
>
> >..with a
> > BorderLayout (at the EAST there are some buttons,
>
> Button or JButton?

JButton

>
> >..and the panel is inside some other panel/box).
>
> ..box? What is that?

Box

>
> > How can I do to get this scollpanel/table combo to fit all the
> > available space in the panel, besides that taken up by the buttons?
> >
> > I found the call setPreferredScrollableViewportSize() can be used to do
> > this resizing, but I don't know from where this can be called, and how
> > one would compute this preferred size.
> >
> > I find Swing to be a really primitive toolkit when it comes to layout.
>
> Probably because you are not familiar with using it.
> Writing X-plat GUI's relies on logical layouts, and using
> logic to layout a GUI (as opposed to 'shove it there')
> often represents a significant learning curve for
> anybody starting with them.
>
> If you have not already done them, I strongly recommend
> "Using Layout Managers" from the Java Tutorial.
> <http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html>

No. It's because I have used modern things like Garnet.


Thanks

.