I see a JToolBar
in BorderLayout.NORTH
, a JTabbedPane
in BorderLayout.CENTER
and a JPanel
using FlowLayout.RIGHT
in BorderLayout.SOUTH
. BorderFactory
can supply the titled border.
Addendum: I have to create two top headers.
If you need two top headers, you can add two instances of JToolBar
to a JPanel
having GridLayout(0, 1)
, then add that panel to BorderLayout.NORTH
. See also this nested panel example. Use Action
to encapsulate your toolbar behaviors, for example.
Addendum: Whenever the advanced toolbar button is clicked, I want to remove the generalTabbedPane
and show the advanceTabbedPane
and vice versa.
You could use CardLayout
, shown here, to accomplish this. A better approach might be to let each tab's abstract parent implement a suitable interface method, e.g. setAdvanced()
. The default would do nothing, but some concrete implementations could respond accordingly.