@Override
    public void runLoop() {
        // This method is overridden to do restart
        if (needRestart.getAndSet(false)) {
            try {
                createContext(settings);
            } catch (LWJGLException ex) {
                logger.log(Level.SEVERE, "Failed to set display settings!", ex);
            }
            listener.reshape(settings.getWidth(), settings.getHeight());
            if (renderable.get()) {
                reinitContext();
            } else {
                assert getType() == Type.Canvas;
            }
            logger.fine("Display restarted.");
        } else if (Display.wasResized()) {
            int newWidth = Display.getWidth();
            int newHeight = Display.getHeight();
            settings.setResolution(newWidth, newHeight);
            listener.reshape(newWidth, newHeight);
        }

        super.runLoop();
    }
@param width The required display width
@param height The required display height
@param bpp The required bits per pixel. If -1 is passed it will return
          whatever bpp is found
@param freq The required frequency, if -1 is passed it will return
            whatever frequency is found
@return The {@link DisplayMode} matches with specified settings or
        return null if no matching display mode is found
jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglDisplay.java