Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a JPanel with the same size as its JTabbedPane container

Status
Not open for further replies.

Swamphen

Programmer
Jul 17, 2001
84
0
0
IT
The layout of my GUI contains

- a JFrame with GridBagLayout
- this JFrame contains a JInternalFrame and a JTabbedPane
(JInternalFrame has gridwidth 2 and JTabbedPane gridwidth 1)
- The JTabbedPane contains a JPanel for each tab and these JPanels have GridBagLayouts and contain various components.

The problem is that the JPanel doesn't occupy the entire possible space of the JTabbedPane and thus the JPanel components are clutched together in the center of the JTabbedPane.

I've tried to use a BorderLayout and a GridBagLayout for the JTabbedPane, but to no avail.

What to do next?

Swamphen
 
The answer was quite silly.

I didn't realize the JTabbedPane consisted of an instance of a special JPanel subclass. And that special JPanel contained an ordinary JPanel, which contained the abovementioned components.

Mea culpa.

Swamphen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top