public static String[] getValidResolutions() {
		String[] str;
		ArrayList<String> strings = new ArrayList<String>();
		GraphicsEnvironment gc = GraphicsEnvironment
				.getLocalGraphicsEnvironment();
		DisplayMode[] displayModes = gc.getDefaultScreenDevice().getDisplayModes();
		int sizeX = gc.getDefaultScreenDevice().getDisplayMode().getWidth();
		int sizeY = gc.getDefaultScreenDevice().getDisplayMode().getHeight();
		for (int z = 0; z < displayModes.length; z++) {
			// System.out.println(displayModes[z].getWidth() + "x"
			// + displayModes[z].getHeight());
			if ((double)displayModes[z].getWidth() / (double)displayModes[z].getHeight() ==
					(double)sizeX / (double)sizeY

					&& displayModes[z].getRefreshRate() == gc
							.getDefaultScreenDevice().getDisplayMode()
							.getRefreshRate()
					&& displayModes[z].getBitDepth() == gc
							.getDefaultScreenDevice().getDisplayMode()
							.getBitDepth()) {
				strings.add(displayModes[z].getWidth() + "x"
						+ displayModes[z].getHeight());

			}
		}
		str = new String[strings.size()];
		for (int d = 0; d < str.length; d++) {
			str[d] = strings.get(d);
			System.out.println(strings.get(d));
		}
		return str;
	}