Paul Clapham wrote:Well, assuming that the component you were thinking of was a JTabbedPane, you would do what the tutorial suggests:
How to Use Tabbed Panes wrote:To switch to a specific tab programmatically, use the setSelectedIndex or the setSelectedComponent methods.
Couldn't get that to work, could you give me an example ?
Here's my code :
where "Tabs" is a reference to the object created in the first line of your posted code.
"Tabs" should be "tabs".
"Mframe" should be "mFrame".
If you want to change the selection of a tab then just select the tab. There is no need to create a new tabbed pane. Just do: