0

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,

Kalai Selvan Ravi
  • 2,846
  • 2
  • 16
  • 28
String
  • 3,660
  • 10
  • 43
  • 66

1 Answers1

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).

Shai Almog
  • 51,749
  • 5
  • 35
  • 65