I have a JFrame which I want an initial size 500x400.
For Layout I use GridBagLayout
My JFrame is this:
JFrame( JTabbedPane( JScrollPane(JTextArea) ) )
I want JTabbedPane (with its contents) take whole surface of JFrame even if
I resize JFrame
How can I do this? I am a newbie in Java API.
Hello,
> I have a JFrame which I want an initial size 500x400.
Why specify a fixed size? That isn't good practice. The components'
preferred sizes should dictate the overall size required. The layout
manager will handle that for you.
> For Layout I use GridBagLayout
>
> I want JTabbedPane (with its contents) take whole surface of JFrame even if
> I resize JFrame
I suggest you use JGoodies forms (freeware) rather than GridBagLayout.
JGoodies forms' grid layout is much easier to comprehend and, in your
example, you can specify with easy that the component should fill the frame.
http://www.jgoodies.com/downloads/libraries.html

Signature
Regards/Gruß,
Tarlika Elisabeth Schmitz
This is an example of a situation where GridBagLayout is overkill.
If you give the JFrame a BorderLayout and add() the JTabbedPane in its
CENTER, then the JFrame will always automatically fill the entire JFrame.
> I have a JFrame which I want an initial size 500x400.
>
[quoted text clipped - 7 lines]
>
> How can I do this? I am a newbie in Java API.