Package ch.swingfx.text
Class TextUtil
- java.lang.Object
-
- ch.swingfx.text.TextUtil
-
public final class TextUtil extends java.lang.ObjectUtility class to work with text
-
-
Constructor Summary
Constructors Modifier Constructor Description privateTextUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intcalculatePreferredHeight(java.awt.FontMetrics fm, int maxWidth, java.lang.String text)This method calculates the preferred height for a rectangle that has a width ofmaxWidthand should display the Stringtextinside it with line breaks
-
-
-
Method Detail
-
calculatePreferredHeight
public static int calculatePreferredHeight(java.awt.FontMetrics fm, int maxWidth, java.lang.String text)This method calculates the preferred height for a rectangle that has a width ofmaxWidthand should display the Stringtextinside it with line breaks- Parameters:
fm-FontMetricsto usemaxWidth- the maximum width of the rectangletext- the text we want to display- Returns:
- the preferred height
-
-