user1635256
user1635256

Reputation: 111

Explicitly call a Tab in Tabbed Pane in LWUIT

By default a TabbedPane in LWUIT shows the first tab or tab at Index 0, how can i make it show the second tab or tab at index 1.

Pls provide the piece of code where i can explicitly call a particular tab and show that particular tab instead of first one.

Upvotes: 0

Views: 59

Answers (1)

Zabihullah Alipour
Zabihullah Alipour

Reputation: 635

before you show your form use tabPane.setSelectedIndex(int index) method, index is that tab you want show, and cannot be out of rang(>= tab count). do like this:

tabs tp = new Tabs();
tp.addTab("Tab 0", new Label("Tab 0"));
tp.addTab("Tab 1", new Label("Tab 1"));
tp.setSelectedIndex(1);
....

Upvotes: 2

Related Questions