File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Autoscrolling in a JTextField

 
Matt De
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am making a chat like client. I want it to auto scroll down to keep up with the text. Right now the text is added but the scroll bar doesn't move. I was looking at some scrollable stuff in the API, but I am still new to java and it is hard for me to find the right methods and stuff for what I want to do. I have programming experience, but am still a little confused on find what I need to accomplish certain tasks in java. Thanks for any help given. I have scrollbars in place already I just need any info on how to make the JTextField scroll along as new text extends past the bottom of my JTextField.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Swing/AWT...
 
Steve Morrow
Ranch Hand
Posts: 657
Clojure Spring VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setCaretPosition();

Example:
[ July 29, 2005: Message edited by: Steve Morrow ]
 
Matt De
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks got it to work. I saw something on setCaretPosition but didn't understand it completely. Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic