W.W
W.W

Reputation: 109

Swing : change selected tab value

I want to change the value of the selected tab but I don't know how!

private JTabbedPane tab = new JTabbedPane();

I used that to make the second tab active but it doesn't work : tab.getSelectedIndex()= 2

How to change selected tab value?

Upvotes: 1

Views: 282

Answers (1)

Reimeus
Reimeus

Reputation: 159794

That would be:

tab.setSelectedIndex(2);

All available methods can be found here.

Upvotes: 3

Related Questions