×

Discussion Board

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

    how to scroll the textarea of lwuit in S40_with_theme

    hello,I am working on S40 using sdk2.0 and S40_with_theme.now my requirment is tha i am using TextArea in my code now i am facing problem in scroll the textarea .my text is large but it did not show the invisible text .i am sending the my code
    Code:
    ta=new TextArea();
    		//ta.setScrollVisible(true);
    		 
    		 ta.getUnselectedStyle().setBorder(null, false);
    		  ta.setEditable(false);
                      ta.setRows(stroy.length());
    	          ta.setText(stroy);
    		 ta.setSingleLineTextArea(false);        
    		 ta.setGrowByContent(true);       
    		 ta.setFocusable(false);
    		ta.getUnselectedStyle().setAlignment(Component.CENTER);
    		ta.getSelectedStyle().setAlignment(Component.CENTER);
    Please give me the solution of my problem
    thanks

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

    Re: how to scroll the textarea of lwuit in S40_with_theme

    The first thing to note is that you are assigning your TextArea as much lines (rows) as the length of the string, and that is incorrect. You will get a very big TextArea, with lots of free space at the end.

    OTOH, I'm not sure to understand this part:

    my text is large but it did not show the invisible text
    Could you please clarify the problem?
    -CarlosDL

  3. #3
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: how to scroll the textarea of lwuit in S40_with_theme

    try to limit - ta.setRows(stroy.length()); to number of rows you want your textarea to display and try ta.scrollRectToVisible()
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

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

    Re: how to scroll the textarea of lwuit in S40_with_theme

    thanx.But in S40 no mehtod ta.scrollRectToVisible().it have ta.scrollRectToVisible(arg0, arg1, arg2, arg3, arg4) .BUt i dont know about the argument which is used in this method

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: how to scroll the textarea of lwuit in S40_with_theme

    Use ta.scrollRectToVisible(0,0,10,10) to display top lines... and scroll down - it should work.
    See..http://developer.nokia.com/Resources.../TextArea.html
    to get the required methods to get no. of rows or no. of lines.. displayed ect, set scollsize etc.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

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

    Re: how to scroll the textarea of lwuit in S40_with_theme

    thanx i used ta.scrollRectToVisible(0, 0, 10, 10, ta).After the see the link as u given in this link the method is scrollRectToVisible(int x, int y,int width, int height,Component coordinateSpace).what is the last argument.i used the object of textArea .please tell me how i should use it ......thanx



    )
    Last edited by vikranttanwar@; 2013-08-29 at 06:53.

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

    Re: how to scroll the textarea of lwuit in S40_with_theme

    any body give me the solution of my problem .i got stuck from last three day so please help me
    Thanks...

  8. #8
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: how to scroll the textarea of lwuit in S40_with_theme

    Quote Originally Posted by vikranttanwar@ View Post
    thanx i used ta.scrollRectToVisible(0, 0, 10, 10, ta).After the see the link as u given in this link the method is scrollRectToVisible(int x, int y,int width, int height,Component coordinateSpace).what is the last argument.i used the object of textArea .please tell me how i should use it ......thanx


    )
    Component coordinateSpace is the component according to whose coordinates rect is defined. Rect's x/y are relative to that component (they are not absolute).

    As per the API doc: scrollRectToVisible

    public void scrollRectToVisible(int x,
    int y,
    int width,
    int height,
    Component coordinateSpace)
    Makes sure the component is visible in the scroll if this container is scrollable
    Parameters:
    x -
    y -
    width -
    height -
    coordinateSpace -the component according to whose coordinates rect is defined. Rect's x/y are relative to that component (they are not absolute).

    This Component according to whose coordinates rect is defined can be your textarea container.
    Last edited by im2amit; 2013-08-29 at 07:54.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

Similar Threads

  1. Lwuit how to make textarea scroll by page
    By Youssef77 in forum Mobile Java UI and User Experience
    Replies: 4
    Last Post: 2013-08-31, 16:39
  2. how to show text in multiple lines in textArea in S40_with_theme
    By vikranttanwar@ in forum Mobile Java UI and User Experience
    Replies: 6
    Last Post: 2013-08-09, 17:44
  3. Replies: 2
    Last Post: 2012-11-23, 08:39
  4. LWUIT TextArea Problem
    By zzwei in forum Mobile Java General
    Replies: 4
    Last Post: 2012-09-20, 10:12
  5. TextArea won't scroll
    By KimF in forum Nokia N9
    Replies: 1
    Last Post: 2012-01-08, 06:37

Posting Permissions

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