×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    May 2013
    Posts
    280

    Not able to apply textarea in container

    I am making asha app and using s40 with themes jar file to make my app.

    When i am putting my textarea in Container(and that Container in center portion of Borderlayout), the textarea sticks on left side of screen. When i tried it with lwuit 1.5 jar it worked perfectly alright. Due to this issue i am not putting it in container but then textarea is not getting scrolled when putting at center of borderlayout.

    Plz help

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

    Re: Not able to apply textarea in container

    Can you post your code?
    -CarlosDL

  3. #3
    Registered User
    Join Date
    May 2013
    Posts
    280

    Re: Not able to apply textarea in container

    Here is it

    Code:
     thoughttext=new TextArea();                //Textarea declared
    		
    		 newstthought=(String) newthoughtvector.lastElement();                
    		 System.out.println("thought i got is "+newstthought);
    		 thoughttext.setText(newstthought);
    		 thoughttext.repaint();
    		 
    		 thoughttext.setRows(newstthought.length());
    		// thoughttext.getUnselectedStyle().setBorder(null, false);
    		 thoughttext.setPreferredH(middlecomponentHT);
    		 //System.out.println("get the height of middle component is:"+thoughttext.getPreferredH());
    		 thoughttext.setEditable(false);
    		 
    		 thoughttext.setSingleLineTextArea(false);        
    		 thoughttext.setGrowByContent(true);       
    		 thoughttext.setFocusable(false);
    		 //thoughttext.setFocus(false);
    	
    		
    		 thoughttext.getUnselectedStyle().setAlignment(Component.CENTER);
    		 thoughttext.setScrollVisible(true);
    		
    		//thoughttext.getUnselectedStyle().setBgColor(11053224);
    		thoughttext.getUnselectedStyle().setFgColor(32768);
    		 //thoughttext.getStyle().setBgTransparency(0);
    		 thoughttext.setUIID("Label");
    		 Style style =  thoughttext.getUnselectedStyle();
    		 style.setAlignment(Label.CENTER);
    		
    		 style.setBgImage(null);
    		 style.setFgColor(16777215);
    		 style.setBgTransparency(50, true);
    		
    		// style.setBorder(Border.createRoundBorder(20,20));
    		 //style.setBorder(Border.createRoundBorder(20,20, null));
    		 style.setBorder(Border.createRoundBorder(20, 20,false));
    	          style.setPadding(15,0,10, 10);
    		 style.setMargin(Component.LEFT,7);
    		 style.setMargin(Component.TOP,7);
    		 style.setMargin(Component.RIGHT,7);
    		 thoughttext.setUnselectedStyle(style);
    		  first.addComponent(BorderLayout.CENTER,thoughttext);
    // first is name of form
    Last edited by Manpreet_Singh; 2013-09-24 at 05:14.

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

    Re: Not able to apply textarea in container

    Sorry for the late response.

    Were you able to solve this?

    If not, what is "first"? Your code doesn't show where you declared it (and where you added it to the form), and that portion could be important.
    -CarlosDL

  5. #5
    Registered User
    Join Date
    May 2013
    Posts
    280

    Re: Not able to apply textarea in container

    No , still facing issues. first is the name of form .

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

    Re: Not able to apply textarea in container

    The first thing I noticed in your code, is that you are trying to create a TextArea with as many rows as there are chars in the text you want to display:

    Code:
    thoughttext.setRows(newstthought.length());
    This is incorrect and it could cause out of memory errors. Try defining it with 2 rows (it will grow as needed).
    -CarlosDL

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

    Re: Not able to apply textarea in container

    done that. still it is not getting scrolled

  8. #8
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    683

    Re: Not able to apply textarea in container

    change this: thoughttext=new TextArea();
    to this: thoughttext=new TextArea(2, 10);
    and remove those lines:
    thoughttext.setRows(newstthought.length());
    thoughttext.setPreferredH(middlecomponentHT);

Similar Threads

  1. how to close first container and open second container
    By bellerophon in forum Symbian User Interface
    Replies: 1
    Last Post: 2012-07-09, 12:09
  2. TextArea won't scroll
    By KimF in forum Nokia N9
    Replies: 1
    Last Post: 2012-01-08, 05:37
  3. Replies: 2
    Last Post: 2011-05-18, 00:19
  4. TextArea Problem
    By nitant_flashlite in forum [Archived] Flash Lite on Nokia Devices
    Replies: 1
    Last Post: 2010-05-27, 03:15
  5. TextArea Bug
    By vvvnsk in forum Personal Profile
    Replies: 0
    Last Post: 2005-01-04, 10: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
  •  
×