Results 1 to 2 of 2
  1. #1
    pranav13's Avatar
    pranav13 is offline Member
    Join Date
    Oct 2008
    Location
    Greater Hyderabad
    Posts
    37
    Rep Power
    0

    Question [SOLVED] how to scroll jTextArea cousor position to last?

    hi all,
    im adding text to a jTextArea line by line using append() method. i want the scroller to scroll down as the lines increases.
    i 've used setCaretPosition(myTextArea.getRows()-1) but it is not working.

    cn any one pls tell me how to do this?

    thanks in advance!

  2. #2
    pranav13's Avatar
    pranav13 is offline Member
    Join Date
    Oct 2008
    Location
    Greater Hyderabad
    Posts
    37
    Rep Power
    0

    Smile i got the solution!

    hi,
    i myself found the solution for this question.
    its...
    myArea.textArea.setCaretPosition(myArea.textArea.g etText().length() - 1);

Similar Threads

  1. scroll a Jpanel in a JFrame
    By nidhirastogi in forum SWT / JFace
    Replies: 1
    Last Post: 09-07-2008, 03:42 AM
  2. Controlling Page Scroll Position in Jsp....f there are fewer than 4 pages only that n
    By 82rathi.angara in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 07-05-2008, 02:11 PM
  3. code hint scroll bar ?
    By tryit in forum Eclipse
    Replies: 3
    Last Post: 04-28-2008, 07:07 AM
  4. Scroll thumb on the ScrollPanel
    By SteM in forum AWT / Swing
    Replies: 3
    Last Post: 12-05-2007, 06:35 PM
  5. Jtextarea and scroll
    By ziniestro in forum AWT / Swing
    Replies: 2
    Last Post: 06-01-2007, 03:59 PM

Posting Permissions

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