This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes determine with Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "determine with" Watch "determine with" New topic
Author

determine with

David Herzig
Greenhorn

Joined: Aug 17, 2004
Posts: 4
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

Joined: Apr 15, 2004
Posts: 75
if u mean how 2 get the height of the TextPane use the getHieght method


kel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: determine with
 
Similar Threads
Multiple JTextPane referencing trouble
Fixed with/heigth ratio for Swing frame ?
Height and Width proportional algorithm?
Setting the width of a JTextPane
JTextPane viewable area