full screen with changed resolution

I have a Java application that sets full screen mode and alters the resolution to 640 by 480. It works fine if I run the app with the following :

[quote]java -jar -Dsun.java2d.noddraw=true AlienSwarm.jar FULLSCREEN
[/quote]
My issue is the part I’ve highlighted in red. If I leave this bit out then the game “plays” but I just see a black screen. I’m currently trying to convert the program into an exe using netbeans and it unfortunately doesn’t seem to allow such options. Is there a relatively easy way of altering the resolution and yet still play in full screen mode?

I currently check all the modes that the device supports and select one that’s close to what I need. I also hide the cursor. I then use double buffering for running the display. I don’t think I do anything wierd and much of the code for this has been grabbed from sites like this. Any ideas?

Have you tried using another resolution such as 800x600 with the DirectDraw pipeline enabled? What happens if you use the following command line:


java -jar -Dsun.java2d.noddraw=true -Dsun.java2d.opengl=True AlienSwarm.jar FULLSCREEN

Are there any useful error messages dumped to the output console when the application is run from the command line? Oracle has a few other suggestions you can try to see what the issue may be.

It could be that your video drivers or monitor don’t support that low of a resolution as well. Windows versions since XP have only officially supported resolutions of 800x600 on up.

I just tried running at 800x600 but I still get a black screen. I can still hear the game playing (as I could at 640x480) but I just can’t see anything. There are no errors or warnings on the console but looking through that article suggests that the issue is with the direct draw somehow and that it needs disabling. It works fine if I pass the -Dsun.java2d.noddraw=true directive but my problem is I can’t pass this into netbeans for native compilation (or at least I can’t work out how to). I found an equivalent command at the jave level System.getProperties().put(“sun.java2d.noddraw”, “true”); but that doesn’t seem to fix anything like the command line directive.

I don’t suppose anyone knows if you can tell netbeans to include the above directive when building an exe? I have tried all my standard methods when dealing with Java of screaming at the screen, trying random chunks of code of the web, sacrificing chickens etc etc but nothing seems to help.