• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTextArea scrolling problem  RSS feed

 
Patrick Brahami
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've starting a new JDialog, with a JTextArea on it. The text written on it
is set that I have a scroll down bar because it's long.
Now when the dialog opens, the scrollbar is scrolled down, so if someone wants to read from beginning he has to scroll up.
Kind of reversed behavior of what I would like.
How can I open the JDialog such that the JTextArea is scrolled up to maximum?

Thanks in advance.
 
Pavan Kumar Srinivasan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setCaretPosition(0) when appropriate
 
Patrick Brahami
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!