private String getMonospacedFontName() {

		if (monospacedFontName==null) {

			GraphicsEnvironment ge = GraphicsEnvironment.
									getLocalGraphicsEnvironment();
			String[] familyNames = ge.getAvailableFontFamilyNames();
			Arrays.sort(familyNames);
			boolean windows = System.getProperty("os.name").toLowerCase().
								indexOf("windows")>=0;

			// "Monaco" is the "standard" monospaced font on OS X.  We'll
			// check for it first so on Macs we don't get stuck with the
			// uglier Courier New. It'll look funny on Windows though, so
			// don't pick it if we're on Windows.
			// It's found on Windows 1.76% of the time, OS X 96.73%
			// of the time, and UNIX 00.00% (?) of the time.
			if (!windows && Arrays.binarySearch(familyNames, "Monaco")>=0) {
				monospacedFontName = "Monaco";
			}

			// "Courier New" is found on Windows 96.48% of the time,
			// OS X 92.38% of the time, and UNIX 61.95% of the time.
			else if (Arrays.binarySearch(familyNames, "Courier New")>=0) {
				monospacedFontName = "Courier New";
			}

			// "Courier" is found on Windows ??.??% of the time,
			// OS X 96.27% of the time, and UNIX 74.04% of the time.
			else if (Arrays.binarySearch(familyNames, "Courier")>=0) {
				monospacedFontName = "Courier";
			}

			// "Nimbus Mono L" is on Windows 00.00% (?) of the time,
			// OS X 00.00% (?) of the time, but on UNIX 88.79% of the time.
			else if (Arrays.binarySearch(familyNames, "Nimbus Mono L")>=0) {
				monospacedFontName = "Nimbus Mono L";
			}

			// "Lucida Sans Typewriter" is on Windows 49.37% of the time,
			// OS X 90.43% of the time, and UNIX 00.00% (?) of the time.
			else if (Arrays.binarySearch(familyNames, "Lucida Sans Typewriter")>=0) {
				monospacedFontName = "Lucida Sans Typewriter";
			}

			// "Bitstream Vera Sans Mono" is on Windows 29.81% of the time,
			// OS X 25.53% of the time, and UNIX 80.71% of the time.
			else if (Arrays.binarySearch(familyNames, "Bitstream Vera Sans Mono")>=0) {
				monospacedFontName = "Bitstream Vera Sans Mono";
			}

			// Windows: 34.16% of the time, OS X: 00.00% (?) of the time,
			// UNIX: 33.92% of the time.
			if (monospacedFontName==null) {
				monospacedFontName = "Terminal";
			}

		}

		return monospacedFontName;

	}