Package ch.swingfx.text
Class TextUtil
- java.lang.Object
-
- ch.swingfx.text.TextUtil
-
public final class TextUtil extends java.lang.Object
Utility class to work with text
-
-
Constructor Summary
Constructors Modifier Constructor Description private
TextUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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 ofmaxWidth
and should display the Stringtext
inside 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 ofmaxWidth
and should display the Stringtext
inside it with line breaks- Parameters:
fm
-FontMetrics
to usemaxWidth
- the maximum width of the rectangletext
- the text we want to display- Returns:
- the preferred height
-
-