Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2012
    Posts
    1
    Rep Power
    0

    Post LWUIT Tabs Click Event

    Hii,
    I've created LWUIT tabs ,when the user clicks on any tab ,i want to read an Rss File and i want to display titles with images. Here i am able to load lists related to specific tab individually whenever user clicks on any tab,But the problem comes when the user initially clicks on first tab ,then the titles related to that tab are gets loading,In the middle if the end user clicks on second tab then the titles from tab 1 are getting mix with titles from tab2 and are displayed on tab2..

    Here my code:

    In the Constructor:
    cinemanews = new Vector();
    gossipnews=new Vector();
    cinemaNewsList = new List(cinemanews);
    cinemaNewsList.setScrollVisible(false);
    cinemaNewsList.setRenderer(new NewsListCellRenderer());
    gossipNewsList = new List(gossipnews);
    gossipNewsList.setScrollVisible(false);
    gossipNewsList.setRenderer(new NewsListCellRenderer());
    Button b1=new Button("CinemaNews");
    Button b2=new Button("GossipNews");
    tabs.addTab(b1, cinemaNewsList);
    tabs.addTab(b2,gossipNewsList );
    b2.addActionListener(new ActionListener() {

    public void actionPerformed(ActionEvent ae) {
    if (cinemanewsList .size() == 0) {
    process("xyz.rss");
    Condition = tabs.getTabTitle(1);
    }
    }
    });
    b3.addActionListener(new ActionListener() {

    public void actionPerformed(ActionEvent ae) {
    if (gossipNewsList.size() == 0) {

    process("xyz.rss");
    Condition = tabs.getTabTitle(2);
    }
    }
    });

    form1.addComponent(BorderLayout.CENTER, tabs);
    Here my Condition:

    if (Condition.equals("CinemaNews")) {
    cinemanews.addElement(news);
    form1.show();
    }
    if (Condition.equals("GossipNews")) {
    gossipnews.addElement(news);
    form1.show();
    }
    Can any one pls.. help me ?Is this correct way to identify LWUIT Tab Click Event?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,453
    Rep Power
    20

    Default Re: LWUIT Tabs Click Event

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Click out event
    By rulych in forum AWT / Swing
    Replies: 3
    Last Post: 02-17-2011, 05:43 PM
  2. Double click event
    By Dipke in forum New To Java
    Replies: 3
    Last Post: 10-22-2010, 12:39 PM
  3. click event
    By raman_v in forum Java Servlet
    Replies: 2
    Last Post: 01-08-2010, 01:05 PM
  4. AWT - catching click button event
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-12-2008, 12:02 AM
  5. How to perform some event to button click
    By eva in forum AWT / Swing
    Replies: 2
    Last Post: 01-16-2008, 01:27 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •