• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTextPane sizing  RSS feed

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?

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!