ArrayList resolutions = new ArrayList(16);
ArrayList resolutions = new ArrayList(modes.length);
    private static String[] getResolutions(DisplayMode[] modes) {        ArrayList resolutions = new ArrayList(16);        for (int i = 0; i < modes.length; i++) {            String res = modes[i].getWidth() + " x " + modes[i].getHeight();            if (!resolutions.contains(res))                resolutions.add(res);        }                String[] res = new String[resolutions.size()];        resolutions.toArray(res);        return res;    }