问题
I have created LWUIT Tabs. I want to identify the enduser tab click event and need to place some logic?How to identify tab click Event?
Here my Code:
topnews = new Vector();
topstory = new Vector();
cinemanews = new Vector();
newsList = new List(topnews);
newsList.setScrollVisible(false);
newsList.setRenderer(new NewsListCellRenderer());
myNewsList = new List(topstory);
myNewsList.setScrollVisible(false);
myNewsList.setRenderer(new NewsListCellRenderer());
cinemaNewsList = new List(cinemanews);
cinemaNewsList.setScrollVisible(false);
cinemaNewsList.setRenderer(new NewsListCellRenderer());
Tabs tabs = new Tabs();
tabs.addTab("Topnews", newsList);
tabs.addTab("TopStory", myNewsList);
tabs.addTab("CinemaNews", cinemaNewsList);
tabs.addTabsFocusListener(new FocusListener() {
public void focusGained(Component cmpnt) {
//how to identify the enduser tab click event here?
}
}
thanks,
回答1:
This doesn't seem to be directly supported, there is an option to add a tab with a RadioButton and bind a listener to a button but it would look badly in case of swiping which the tabs component support (dragging the tab in a touch device to the side).
来源:https://stackoverflow.com/questions/12614620/lwuit-tabs-click-event