×

Discussion Board

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

    how to show text in multiple lines in textArea in S40_with_theme

    hello,I am working on S40 using sdk2.0 and S40_with_theme jar file .now i want to show my text in textarea in multiple of lines but it show in single line and cant see text in properly
    i used the code
    TextArea ta=new TextArea();
    ta.setEditable(false);
    ta.setSingleLineTextArea(false);

  2. #2
    Regular Contributor
    Join Date
    Dec 2012
    Location
    India
    Posts
    271

    Re: how to show text in multiple lines in textArea in S40_with_theme

    I have experienced the same bug with LWUIT for S40. I have even filed an issue about it.But there was no response. But I managed to find a workaround for it.Try this

    Code:
    TextArea ta = new TextArea();
    ta.setEditable(false);
    ta.setRowCount(2);
    ta.setGrowByContent(true);
    I am typing this out of memory.Kindly bear if the function name is slightly different.The main thing is the row count has to be set to 2 and the text area should grow by content.Setting the UIID as Label can break this trick.So be careful with that.

    The only disadvantage is that the textarea will look a little bigger for a single line.

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

    Re: how to show text in multiple lines in textArea in S40_with_theme

    can u tell me that how we set alignment of text of button in center as well as set allignment of image
    Button fb=new Button(Image.createImage("/facebook.png"));
    fb.getUnselectedStyle().setAlignment(Component.LEFT);
    fb.setPreferredH(buttonht);
    fb.getUnselectedStyle().setBorder(null);
    fb.setText("FACEBOOK");
    fb.getStyle().setBgTransparency(0);
    fb.getUnselectedStyle().setBorder(null, false);
    but when i set the text in center it give the exception i used
    fb.setTextPosition(Component.CENTER)
    then it does not set in center give an errror what is the reason behind it
    thanks

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

    Re: how to show text in multiple lines in textArea in S40_with_theme

    Quote Originally Posted by arunkam View Post
    I have experienced the same bug with LWUIT for S40. I have even filed an issue about it.But there was no response. But I managed to find a workaround for it.Try this

    Code:
    TextArea ta = new TextArea();
    ta.setEditable(false);
    ta.setRowCount(2);
    ta.setGrowByContent(true);
    I am typing this out of memory.Kindly bear if the function name is slightly different.The main thing is the row count has to be set to 2 and the text area should grow by content.Setting the UIID as Label can break this trick.So be careful with that.

    The only disadvantage is that the textarea will look a little bigger for a single line.
    It is just ta.setRows(2);
    -CarlosDL

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

    Re: how to show text in multiple lines in textArea in S40_with_theme

    Quote Originally Posted by arunkam View Post
    ...
    The only disadvantage is that the textarea will look a little bigger for a single line.
    There is also a workaround for that...
    -CarlosDL

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

    Re: how to show text in multiple lines in textArea in S40_with_theme

    Quote Originally Posted by vikranttanwar@ View Post
    can u tell me that how we set alignment of text of button in center as well as set allignment of image
    but when i set the text in center it give the exception i used
    fb.setTextPosition(Component.CENTER)
    then it does not set in center give an errror what is the reason behind it
    thanks
    You can't use CENTER as the argument for setTextPosition. You can use TOP, BOTTOM, RIGHT or LEFT only.
    -CarlosDL

  7. #7
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    685

    Re: how to show text in multiple lines in textArea in S40_with_theme

    and if you want to align anything to be center horizontly then you have to set its style alignment to center (all of its styles based on whether it goes through the pressed,disable, unselected, selected state)
    so fb.getUnselectedStyle().setAlignment(Componenet.CENTER);
    fb.getSelectedStyle().setAlignment(Componenet.CENTER);
    fb.getPressedStyle().setAlignment(Componenet.CENTER);
    fb.getDisabledStyle().setAlignment(Componenet.CENTER);

Similar Threads

  1. TextArea max. text length
    By pixsta in forum [Archived] Qt Quick
    Replies: 1
    Last Post: 2011-10-06, 09:21
  2. Draw Multiple Lines
    By wyjw1015 in forum Symbian
    Replies: 6
    Last Post: 2008-12-17, 11:06
  3. Replies: 4
    Last Post: 2008-08-25, 11:06
  4. List not display text in multiple lines
    By erracid8 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 5
    Last Post: 2004-08-09, 20:34
  5. List not display text in multiple lines
    By erracid8 in forum Mobile Java General
    Replies: 0
    Last Post: 2004-07-21, 16:22

Posting Permissions

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