0

So I am using the DisplayMode to set my resolution for a fullscreen as follows

DisplayMode dm = new DisplayMode(1440,900,64, DisplayMode.REFRESH_RATE_UNKNOWN);

My question is, Is there anything that I can put in place of 1440, 900 to get the app to set the resolution to whatever the computer it is running on is currently at?

TAM
  • 347
  • 4
  • 9
  • 20

1 Answers1

0

Take a look at Toolkit#getScreenResolution and Toolkit#getScreenSize for starters

You can also use (something similar to)

GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gd = ge.getDefaultScreenDevice();

Rectangle bounds = gd.getDefaultConfiguration().getBounds();

to get the screen bounds of given GraphicsDevice/screen (the example gets the default screen device)

Take a look at GraphicsEnvironment and GraphicsDevice for more details

MadProgrammer
  • 343,457
  • 22
  • 230
  • 366