Search code examples
javaswingtabsjtabbedpanesplitpane

How can I create SplitPane that right side contains tabs for displaying on left side?


I want to create a splitpane like this:

enter image description here

how can I make this. when I add tabs I can add them only in the positions: TOP , BOTTOM , RIGHT , LEFT.

This is what I have: enter image description here

How can I do this?


Solution

  • The panel on the left side should use a CardLayout.

    The panel on the right side can display JButtons. When you click on the button you swap the panel on the left side.

    Read the section from the Swing tutorial on How to Use CardLayout for more information and working examples.