How to create a simple JTabbedPane?
JTabbedPane allows some components such as panels to share the same view. By selecting the corresponding tab the panel will be displayed on the user's screen. To add tabs to the JTabbedPane class you can use the addTab() method.
To the addTab() method pass the title of the tab and the component you wish to display as the content of the tab. In the snippet below we just pass a simple JPanel as the content of the tab. You can also define an image icon for the tab which makes the program looks better.
Here is a simple example creating JTabbedPane containing three tabs, the Dashboard, Transactions and Account tab.