Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Autoscroll of JTextArea

 
Bredan Tomong
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
Following is a piece of code in my "Connection" program. Sometimes the TextArea - display scrolls automaticly, but sometimes it doesn't.
Can anybody tell me why?
Thanks,
JTextArea display = new JTextArea(15, 40);
display.setBackground(Color.cyan);
display.setEditable(false);
JScrollPane js = new JScrollPane(display);
js.setAutoscrolls(true);
//display.setAutoscrolls(true);
display.setToolTipText("Messages");
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

because it's auto-scroll thats' why!
(arrr....that was the seinfeld inside me...sorry, couldn't
resist )
On a more serious not, when autoscroll is set the right way,
the scrolls appear when the text content is more than the visible area. if the text content can fit in the visible area, the scrolls don't show-up.
Not sure if this is what you were looking for, maybe I missed your point...
regds.
- satya

 
Bredan Tomong
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jerry Seinfield doesn't know Autoscroll, Elaine knows.
It's not that simple. I thought I wasn't talk about "appear".
Just like a chat room, when you receive a long message, you don't wanna scroll down yourself. In my situation, I have to scroll it down sometimes.
Thanks,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic