Adjusting Screen Resolution
Hi everyone,
I wanted to know if it is possible to set the Screen Resolution at the start of my program. The main window for my program is 1250 by 815 and I want to be able to display all of it on the user's screen. I do NOT want to use the Full Screen mode, since the user often needs to reference other documents while they are working with the program.
Any suggestions and help is appreciated.
Re: Adjusting Screen Resolution
After a quick google search I found this post, which seems pretty promising: How to set screen resolution (Game Development forum at JavaRanch)
Re: Adjusting Screen Resolution
Unfortunately, that method only works if you have a full screen app, and there's no equivalent for changing the "native" (non-full screen) resolution in pure Java*. Furthermore, there's only a limited number of resolutions you can change the monitor to. If someone's monitor is big enough, you can use a larger monitor to ensure that your window fits, but if the maximum resolution on their monitor is smaller, there's nothing you can do about it (ex. some monitors have a maximum resolution of 1024*768, therefore it's impossible for you to adjust the resolution above that even with native code).
*note: when I say only works in full screen mode, I mean only works safely in full screen mode. The JVM implementation must support it for each specific OS, which unfortunately is not the case. I know the Sun JVM for Windows will only let change the resolution of full screen applications, otherwise you'll get an UnsupportedOperationException. I can't remember where I read/heard this, but I think the only OS's which do support this operation for non-full screen mode are Linux and Solaris (don't take my word for this, though).