user2592244
user2592244

Reputation: 17

How to set tab as default tab in swing

My form contains 7 tabs. I want to get 3rd tab as default tab in my application whenever user enter in my application then user will get window with 3rd tab.

Upvotes: 1

Views: 2474

Answers (1)

mcsilvio
mcsilvio

Reputation: 1098

Have a look here.

In particular, you want to employ this on your JTabbedPane:

yourtabbedPane.setSelectedIndex(yourdesiredindex);

This explains how to set the current tab in JTabbedPane. You want to put this code in the most appropriate event-handler.

Upvotes: 4

Related Questions