Tabs are reset
I am creating a GUI where the main window will contain multiple tabs. They should be located next to each other horizontally.
Using this code makes a "collapsed" version where I can switch tabs with arrows.
JTabbedPane tabs = new JTabbedPane();
JPanel tab_virksomheder = new JPanel();
tabs.addTab("Virksomheder", tab_virksomheder);
JPanel tab_praktikpladser = new JPanel();
tabs.addTab("Praktikpladser", tab_praktikpladser);
panel.add(tabs);
How to make bookmarks stand next to each other?
source to share
The exact result depends on several things:
-
TabbedPaneUI framework,
AquaTabbedPaneUI
in Mac OS X. -
The value set in
setTabLayoutPolicy()
. -
The preferred content size used when
pack()
is called upon conclusionWindow
.
You can use this example to experiment with different Look & Feel settings. Notice how the preferred content size determines the size of each tab content area.
source to share