How to change the default position of a cursor in a JTextArea?

Buras

I have a _result JtextArea. Every second there is a new piece of text String being appended to it. By default, the cursor is at the top. I need the cursor always to be at the very end of the text in the JTextArea. So that I could see what is the last String being appended.

  _result.append("my text");
    // How do I make the cursor of `_result` JTextArea to be at the end of the text?
user2277872

Maybe this will help.

_result.setCaretPosition(_result.getText().length());  

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How to change the default cursor position of a JTextArea?

분류에서Dev

How to jump back to the last position of the cursor in emacs?

분류에서Dev

How to change first view position

분류에서Dev

Change line spacing in JTextArea (not JTextPane)

분류에서Dev

How to add JScrollPane on the JTextArea?

분류에서Dev

How to change color of the bubble (under cursor) on EditText in Flutter

분류에서Dev

How to change default selection color of a ListView?

분류에서Dev

How to change the default value of stage field

분류에서Dev

How can I change the default gateway?

분류에서Dev

How to change the default width of pnotify Jquery plugin?

분류에서Dev

How to change the default filemanager of the Cinnamon desktop?

분류에서Dev

How can I change the default Nautilus Bookmarks?

분류에서Dev

How to change default settings for source control in TFS?

분류에서Dev

How to change default login URL in Laravel 5?

분류에서Dev

How change the default desktop manager in debian?

분류에서Dev

Custom Cursor Adapter ( get position )

분류에서Dev

How to see current column/character number of the cursor position in Sublime Text 3?

분류에서Dev

Vim, how to delete from CURRENT cursor position, until end of line and next N lines?

분류에서Dev

how do you make a Rectangle change it's position or move?

분류에서Dev

How to change the position of text "No data available in table" in datatables?

분류에서Dev

How to change CSS background-position for the X axis only?

분류에서Dev

Where does gedit store the last cursor position?

분류에서Dev

Get Cursor Position With Input type number

분류에서Dev

vim keep cursor position when counting matches

분류에서Dev

Cursor changes appearance and position in Windows 10

분류에서Dev

Ubuntu terminal - go to mouse cursor position

분류에서Dev

How do you change the default document viewer to Okular?

분류에서Dev

How can I change the version (default-series) that Juju deploys?

분류에서Dev

How can I change the default google account in google chrome?

Related 관련 기사

  1. 1

    How to change the default cursor position of a JTextArea?

  2. 2

    How to jump back to the last position of the cursor in emacs?

  3. 3

    How to change first view position

  4. 4

    Change line spacing in JTextArea (not JTextPane)

  5. 5

    How to add JScrollPane on the JTextArea?

  6. 6

    How to change color of the bubble (under cursor) on EditText in Flutter

  7. 7

    How to change default selection color of a ListView?

  8. 8

    How to change the default value of stage field

  9. 9

    How can I change the default gateway?

  10. 10

    How to change the default width of pnotify Jquery plugin?

  11. 11

    How to change the default filemanager of the Cinnamon desktop?

  12. 12

    How can I change the default Nautilus Bookmarks?

  13. 13

    How to change default settings for source control in TFS?

  14. 14

    How to change default login URL in Laravel 5?

  15. 15

    How change the default desktop manager in debian?

  16. 16

    Custom Cursor Adapter ( get position )

  17. 17

    How to see current column/character number of the cursor position in Sublime Text 3?

  18. 18

    Vim, how to delete from CURRENT cursor position, until end of line and next N lines?

  19. 19

    how do you make a Rectangle change it's position or move?

  20. 20

    How to change the position of text "No data available in table" in datatables?

  21. 21

    How to change CSS background-position for the X axis only?

  22. 22

    Where does gedit store the last cursor position?

  23. 23

    Get Cursor Position With Input type number

  24. 24

    vim keep cursor position when counting matches

  25. 25

    Cursor changes appearance and position in Windows 10

  26. 26

    Ubuntu terminal - go to mouse cursor position

  27. 27

    How do you change the default document viewer to Okular?

  28. 28

    How can I change the version (default-series) that Juju deploys?

  29. 29

    How can I change the default google account in google chrome?

뜨겁다태그

보관