Java Utililty Methods Graphics Draw Multiline String

List of utility methods to do Graphics Draw Multiline String

Description

The list of methods to do Graphics Draw Multiline String are organized into topic(s).

Method

intpaintMultilineText(Graphics2D g2d, String text, int textX, int textWidth, int textY, int maxTextLineCount)
paint Multiline Text
FontRenderContext frc = new FontRenderContext(new AffineTransform(), true, false);
int fa = g2d.getFontMetrics().getAscent();
if (text.length() == 0)
    return textY;
int currOffset = 0;
AttributedString attributedDescription = new AttributedString(text);
attributedDescription.addAttribute(TextAttribute.FONT, g2d.getFont());
LineBreakMeasurer lineBreakMeasurer = new LineBreakMeasurer(attributedDescription.getIterator(), frc);
...