List of utility methods to do Graphics Draw Multiline String
int | paintMultilineText(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); ... |