This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

determine with

 
David Herzig
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Java Users

I have a JTextPane with LineWrap, which works great. The Linebreak inside the JTextPane depends on the Frame width. If the Frame�s width is very small, there will be more linebreaks, which means the JTextPane�s height is bigger. Now I want to find out the ideal height of a JTextPane, if I insert it into a Component with a specific width. Does anyone have an idea how to solve this problem?

Many thanks in advance

regards dave
 
kelly devon
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if u mean how 2 get the height of the TextPane use the getHieght method
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic