2012-09-27 142 views
0

我已經創建了LWUIT選項卡。我想識別最終用戶標籤點擊事件,並需要放置一些邏輯?如何識別標籤點擊事件?LWUIT標籤點擊事件?

這裏我的代碼:

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? 
     } 
    } 

感謝,

回答

1

這似乎並不直接支持,還有就是添加一個標籤與RadioButton和綁定監聽到按鈕的選項,但在標籤組件支持的滑動情況下(拖動觸摸設備中的標籤到側面)​​,它會看起來很糟糕。