public static final int getPreferredHeight(Font font, String text) {
		int height = 0;
		int length = text.length();
		if (length > 0) {
			int fHeight = getFontHeight(font);
			char ch = 0;
			for (int i = 0; i < length; i++) {
				ch = text.charAt(i);
				if (ch == '\n') {
					height += fHeight;
				}
			}
			if (ch != '\n') {
				height += fHeight;
			}
		}
		return height;
	}