Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Swing application, screen resolution question  RSS feed

 
SteveThompson
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Swing application, which utilises a number of images.
The optimum resolution is 800 x 600.
Is there any way that I can amend the user's screen resolution, as part of the application.
I'm sure I have seen this done in non-Java games.
Any idead?
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Steve,
Welcome to JavaRanch. Are you sure you want to change the user's screen resolution? That's almost like being a guest in someone's house and rearranging the furniture during your visit. You may not be able to do it anyway and certainly not 100% of the time (at least with the core API). Here's what you can try:

The listScreens() method just enumerates all the supported screen configurations. The second attempt to set the screen to a particular resolution, bit depth and refresh rate. My partiuclar machine config does not support low level graphics hardware changes, so I get the exception.
Michael Morris
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!