File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Autoscrolling in a JTextField Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Autoscrolling in a JTextField" Watch "Autoscrolling in a JTextField" New topic

Autoscrolling in a JTextField

Matt De

Joined: Jul 29, 2005
Posts: 5
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

Joined: Jul 11, 2001
Posts: 14112
Moving to Swing/AWT...

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Steve Morrow
Ranch Hand

Joined: May 22, 2003
Posts: 657


[ July 29, 2005: Message edited by: Steve Morrow ]
Matt De

Joined: Jul 29, 2005
Posts: 5
Thanks got it to work. I saw something on setCaretPosition but didn't understand it completely. Thanks
I agree. Here's the link:
subject: Autoscrolling in a JTextField
It's not a secret anymore!