LWUIT Tabs click event?

大城市里の小女人 提交于 2019-12-11 14:06:43

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!