public static String wrapString(String str, double maxLength) {
		StringTokenizer st = new StringTokenizer(str);
		double spaceLeft = maxLength;
		int spaceWidth = 1;
		StringBuilder sb = new StringBuilder();
		while (st.hasMoreTokens()) {
			String word = st.nextToken();
			if ((word.length() + spaceWidth) > spaceLeft) {
				sb.append("\n" + word + " ");
				spaceLeft = maxLength - word.length();
			} else {
				sb.append(word + " ");
				spaceLeft -= (word.length() + spaceWidth);
			}
		}
		return sb.toString();
	}