Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTextPane sizing

John Coleman
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using a JTextPane (plain/text) as a scrollable message board in a chatroom application.

Sometimes if a line wraps, the component does not show the bottom line as if it calculates the actual size of the control wrong. If you resize the container then the control gets bigger and displays the last line, along with the vertical scroll bar getting longer. You can then pull the scroll bar down to see the last line.

Is there a way to get the JTextPane component to always have the right size after text is added to its docment?

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic