JTabbedPane and active tab

V

vertigo

Hello
How can i from my code change from one active tab (of JTabbedPane)
to another ?
In constructor i have:
tabbedPane = new JTabbedPane();
tabbedPane.setTabLayoutPolicy(1);
CreatePage1();
tabbedPane.addTab("Page1", page1);
CreatePage2();
tabbedPane.addTab("Page2", page2);

and from menu i want to choose which tab i actually see now.

Thanx
Michal
 
T

Thomas Weidenfeller

vertigo said:
and from menu i want to choose which tab i actually see now.

JTabbedPane.setSelectedIndex(). See the API documentation for details
(always a good idea to do this first).

/Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,047
Members
48,769
Latest member
Clifft

Latest Threads

Top