×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    May 2013
    Posts
    153

    how add label in list

    I am working on S40 using sdk2.0 and lwuit 1.5.now my requirment is that how i can add five label in list pleae tellme

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: how add label in list

    if you want to add five labels in a single list cell item, it should be straight forward.

    Make a container and set layout of your choice and add five labels to it !!

    Hope this makes sense to you !!

  3. #3
    Registered User
    Join Date
    May 2009
    Location
    Guatemala
    Posts
    186

    Re: how add label in list

    If that doesn't help, please provide more details about your requirement.
    -CarlosDL

  4. #4
    Registered User
    Join Date
    May 2013
    Posts
    153

    Re: how add label in list

    but i want to perform selection listener in list after adding label in container how is it possible.suppose if i want to print more than 100 string so i want to print in label and these label should add on as a list item. i implemented a code given below.
    Code:
    protected void startApp()  {
    		// TODO Auto-generated method stub
    		Display.init(this);
    		//Display.getInstance().setForceFullScreen(true);
    		 f=new Form();
    		 f.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
    		Button b=new Button();
    		Label b1=new Label("vicky");
    		Label b2=new Label("tanwar");
    		b.addActionListener(new ActionListener() {
    			
    			public void actionPerformed(ActionEvent arg0) {
    				// TODO Auto-generated method stub
    				SecondForm sc=new SecondForm(f);
    				sc.showform();
    			}
    		});
    		List l=new List();
    		//l.addItem(b);
    		l.addItem(b1);
    		l.addItem(b2);
    		f.addComponent(l);
    		f.addComponent(b);
    		f.show();
    		
    		
    	}
    BUT no button and label add in list.

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: how add label in list

    Sorry but i am not getting any clue on what you want to do

    But my guts says you want to add labels to your list when you click any list item , Is this correct ??

  6. #6
    Regular Contributor
    Join Date
    Dec 2012
    Location
    India
    Posts
    266

    Re: how add label in list

    I am not sure why you talk about the button here.Anyways
    Code:
    Button b=new Button();
    f.addItem(b);
    The Button is initialized with no string or Image.Hence,depending on the theme, your button may or may not appear properly.
    Secondly,The Button is added to form and not the list.

    From what I have understood about your requirement, I Think your situation is fairly straight forward.Use this

    Code:
    List l = new List();
    l.addItem("This is the first entry");
    l.addItem("This is the second entry");
    l.addSelectionListener(new SelectionListener() {
    
                public void selectionChanged(int oldSelected, int newSelected) {
             
                    System.out.println("The selection has changed from "+oldSelected+" to "+newSelected);
    
                }
            });
    Implement you business logic in the selectionChanged function.

  7. #7
    Registered User
    Join Date
    May 2013
    Posts
    153

    Re: how add label in list

    thanks arunkam

Similar Threads

  1. How to change the colour of selected label on list view
    By Manpreet_Singh in forum Mobile Java UI and User Experience
    Replies: 3
    Last Post: 2013-07-28, 10:40
  2. List box with two icons followed by label
    By jinuthomas in forum Symbian User Interface
    Replies: 3
    Last Post: 2009-07-29, 16:00
  3. Is there a way to add a checkbox & label together in list.
    By smanikandan14 in forum Symbian User Interface
    Replies: 8
    Last Post: 2008-10-27, 15:02
  4. Label in the List dialog
    By Tejaswini in forum Symbian User Interface
    Replies: 1
    Last Post: 2007-07-23, 08:35
  5. List and Label in a dialog
    By knmehta in forum Symbian User Interface
    Replies: 2
    Last Post: 2005-08-10, 14:44

Posting Permissions

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