×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jun 2013
    Posts
    20

    Lwuit how to make textarea scroll by page

    Hi I'm developing using lwuit 1.5
    i wonder how to make a textarea scroll by page
    (i tried getline, getlinetoscroll but it didn't work)
    P.S i put the textarea in the center constraint in the borderlayout so i didn't specify a preferred h
    & Thanks in advance

  2. #2
    Registered User
    Join Date
    Jun 2013
    Posts
    20

    Re: Lwuit how to make textarea scroll by page

    Hi I found a code that it might be the solution which is:
    Font textFont = textarea.getStyle().getFont();
    int linesOfScreen = textarea.getHeight() / (textFont.getHeight() + textarea.getRowsGap());
    textarea.setRows(linesOfScreen);
    but the problem is that the textarea.getHeight() give a value of zero
    & the textarea.getPreferredH() give the value of 30
    so it scroll with one line only
    but I'm sure that if I could get the really height value of the textarea it will work
    p.s: I'm using a borderlayout & I put the textarea in the center of the borderlayout
    So could anybody help me with that
    & Thanks in advance

  3. #3
    Registered User
    Join Date
    Jun 2013
    Posts
    20

    Re: Lwuit how to make textarea scroll by page

    Hi
    when I tried the code on a button it gives a correct value of number of line that appear on the textarea
    but what I need now is how when the user press a down button it goes to the desired line
    for example say that the number of line that appear is 5
    I want that when the user press a down button it goes to the line number 6
    & thanks in advance

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

    Re: Lwuit how to make textarea scroll by page

    Refer to - http://teguhwahyudi.blogspot.in/2011...em-solved.html

    You may need to override the text area class and pay with cursor position - to scroll page wise - place the cursor to last line of the first page on creation + (no of lines on the page) - to scroll it to next page on every down key press/release event.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  5. #5
    Registered User
    Join Date
    Jun 2013
    Posts
    20

    Re: Lwuit how to make textarea scroll by page

    Thank you im2amit very much
    I tried to play with the textarea class and it works

Similar Threads

  1. Unable to make LWUIT Textarea to grow by content
    By ChinLoong in forum Mobile Java General
    Replies: 10
    Last Post: 2013-01-16, 07:26
  2. Replies: 2
    Last Post: 2012-11-23, 07:39
  3. LWUIT TextArea Problem
    By zzwei in forum Mobile Java General
    Replies: 4
    Last Post: 2012-09-20, 10:12
  4. TextArea won't scroll
    By KimF in forum Nokia N9
    Replies: 1
    Last Post: 2012-01-08, 05:37
  5. Replies: 3
    Last Post: 2011-07-19, 07:50

Posting Permissions

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