Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem when changing Screen Resolution

807597May 30 2005 — edited May 31 2005
Hi all,

I have an application that needs to run in 800x600 resolution no matter what PC it runs on so I used the following code:
public static void main(String args[]) {
        JFrame windo = new pdtester();
        windo.setVisible(true);
        
     GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();

     /**find out if the device we are using is even capable of
      *supporting full screen*/
     if (device.isFullScreenSupported()) {
      DisplayMode display = new DisplayMode(800,600,32,0);

      try {
        device.setFullScreenWindow(windo);
        device.setDisplayMode(display);
      } catch (Exception e) {
          //exception handling here
      } 
 
 
 }
        
        


    }
it seems to work and the program executes in 800x600 but the problem is the graphics dont seem to refresh and they only show when you scroll over them etc... I assume its something to do with the refresh rate set at zero at present. I've tried 50 and display.REFRESH_RATE_UNKNOWN but I get the same problem.

Any ideas would be appreciated.

Thanks,

John
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 28 2005
Added on May 30 2005
6 comments
283 views