DisplayMode mode = getValidDisplayMode(width, height, bpp, frq);
DisplayMode mode = selectMode();
    private void initDisplay() {        // create the Display.        DisplayMode mode = getValidDisplayMode(width, height, bpp, frq);        PixelFormat format = new PixelFormat(bpp, alphaBits, depthBits,                stencilBits, samples);        if (null == mode) {            throw new JmeException("Bad display mode");        }        try {            Display.setDisplayMode(mode);            Display.setFullscreen(fs);            if (!fs) {                int x, y;                x = (Toolkit.getDefaultToolkit().getScreenSize().width - width) >> 1;                y = (Toolkit.getDefaultToolkit().getScreenSize().height - height) >> 1;                Display.setLocation(x, y);            }            Display.create(format);            // kludge added here... LWJGL does not properly clear their            // keyboard and mouse buffers when you call the destroy method,            // so if you run two jme programs in the same jvm back to back            // the second one will pick up the esc key used to exit out of            // the first.            Keyboard.poll();            Mouse.poll();        } catch (Exception e) {            // System.exit(1);            LoggingSystem.getLogger().log(Level.SEVERE, "Cannot create window");            LoggingSystem.getLogger().throwing(this.getClass().toString(),                    "initDisplay()", e);            throw new Error("Cannot create window: " + e.getMessage());        }    }