19. marts 2004 - 12:27Der er
10 kommentarer og 1 løsning
Automatic JTextArea scrolling
Hey,
I have a JTextArea within a JScrollPane which gets updated/appended with text when you press enter. However, the scrollbar won't scroll down automatically. It works fine after you've dragged the mouse in the text area once.
I want the scroller to begin scrolling automatically without having to manually scroll first! I've tried various repaint() and revalidate() and setPreferredSize() and requestFocus() and setValue() methods but neither works the way I want it to.
Jeg skulle lige til at protestere, men har lige siddet og leget lidt med det, og du har ret, hvis klikker med musen i JTextArea'et og flytter tilbage til sit TextField, så scroller den faktisk ikke til nederste linie
Glad that we could help, you now only have one thing to do, which is to close this question. That is done by accepting one or more af the answers provided to this question an give points to the person/persons who provided you with code that solved your problem. Here you have 3 possibilityes (because you answered it your self), which is to accept your own, mikkelbm's or my answer and thereby provide the person/persons with points
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.