• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Java, putting JTabbedPane content in center of page.

l11h

Junior Member
Hi,

i am new to Java programming. This is what i have done, i have created 5 separate classes, 4 of them are GUI's and one final class which combines all of them.

the one that collects all other GUI's is the JTabbedPane class, this class basically has classname name = new classname(); and then tab.add("name", name); and then showing the class making it visible.

The problem is the JTabbedPane window has all content at top, i want the content in the middle of the page.

I have tried adding BoxLayout and GridBagLayout, but what these do is put the tab in the middle but there is A LOT of white space, the tabs dont re-size themselves with the frame window.

I would appreciate all help on how i can get the GUI's in the middle of the JTabbedPane.

ty 🙂 .
 
The component for the frame you are adding the JTabbedPane to should be given a BorderLayout and then you add the JTabbedPane to the Centre. Then it will expand to fit the whole component as you are expecting.
 
Back
Top