Exception when trying to use fullscreen


I am trying to use fullscreen mode through an AppSettings object through the method setFullscreen(). Now when I do this I get following exception:

java.lang.RuntimeException: Unable to find fullscreen display mode matching settings

The code is following:


AppSettings settings = new AppSettings(true);




What did I miss?

i guess your screen does not support the resolution you set in full screen mode.

IE maybe 640x480 cannot be set full screen on a 16/9 screen…

try to change the resolution to one supported by your screen and drivers.

I see. Is there a way to find out the supported/used resolution(s) of the user when starting the app?

/edit: when I set the same settings through the display settings window it works.

mhh That’s strange.

What resolution do you use?

Tried it with 800x600 and 1920x1080.

/edit: Now that I set a higher frequency it works.

Similar problem here.

Is there a way to find out supported Combinations of fullscreen and resolution and frequency?

Without that my Options Menu allowing for a change in resolution and fullscreen is prone to result in crashing games.

Selecting any resolution and fullscreen or not in the settings menu preceeding the game is working fine.

Changing to these resolutions is shaky at best and doesn’t work most of the time.

Any help appreciated!

The AppSettings panel does this, yeah. Basically use the DisplaySystem class to get information about supported resolutions etc.

Thanks @normen!

But if I am not wrong there is no longer a DisplaySystem class in jme3?

I’m trying like that now:

GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();

Sorry, it was GraphicsEnvironment. It’s not a jme3 specific class: java.awt.GraphicsEnvironment Anyway, look at the source of SettingsDialog (nothing more to do than just right-click that name in the editor and select “go to source”).

1 Like