final Tabs tab = findTabs1(f);
tab.addSelectionListener(new SelectionListener() {
public void selectionChanged(int oldSelected, int newSelected) {
System.out.println("selected :: " + newSelected);
if ((newSelected == 0) || (newSelected == 2)) {
f.getMenuBar().removeAll();
f.getMenuBar().addCommand(sendSMS);
f.getMenuBar().addCommand(advSearch);
f.getMenuBar().addCommand(myProfile);
f.getMenuBar().addCommand(abtUS);
f.getMenuBar().revalidate();
} else if (newSelected == 1) {
f.getMenuBar().removeAll();
f.getMenuBar().addCommand(sendSMS);
f.getMenuBar().addCommand(advSearch);
f.getMenuBar().addCommand(myProfile);
f.getMenuBar().addCommand(newPost);
f.getMenuBar().addCommand(abtUS);
f.getMenuBar().revalidate();
}
}
});
f.getMenuBar().addCommand(sendSMS);
f.getMenuBar().addCommand(advSearch);
f.getMenuBar().addCommand(myProfile);
f.getMenuBar().addCommand(abtUS);
f.getMenuBar().revalidate();
What I mean is that if I select, say, tab 1, then select tab 2 and then select tab 1 again, the action on tab 1 is not called the second time.
If the currently selected tab is clicked again you won't be an event since no selection occurred.
You can bind your own listeners to the tab buttons if you wish.
--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/XE7WVZwd81c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discu...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/f9f03a8d-3c05-4f5b-bf28-897da6f3449f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
f.getMenuBar().removeAll();
f.removeAllCommands();