public static int drawMultiLineString(Graphics2D g2d, String text, int lineWidth, int x, int y) {
		FontMetrics m = g2d.getFontMetrics();
		int originalY = y;

		if (m.stringWidth(text) < lineWidth) {
			g2d.drawString(text, x, y);
		} else {
			String[] words = text.split(" ");
			String currentLine = words[0];
			for (int i = 1; i < words.length; i++) {
				if (m.stringWidth(currentLine + words[i]) < lineWidth) {
					currentLine += " " + words[i];
				} else {
					g2d.drawString(currentLine, x, y);
					y += m.getHeight();
					currentLine = words[i];
				}
			}
			if (currentLine.trim().length() > 0) {
				g2d.drawString(currentLine, x, y);
			}
		}
		return y - originalY + m.getHeight();
	}