How to scale program to correct screen resolution?
<p>I am putting on a concert at my university in the next forty minutes in which I am projecting a full screen application I wrote on several different screens. I was only able to get hold of the projection system tonight and low and behold when plugged in the resolution of my screen changes drastically but when I execute my program it works as if it is using my old screen resolution. I've coded the entire visual display to exact pixel values but now half of it isn't displaying as it is pushed off the side of the screen. I've tried changing my displays manually in system preferences but it has no effect. I've tried creating different display modes to fit the resolutions but I keep getting the message UnsupportedOperationException: Cannot change display mode. Is there anyway I can scale my program to the correct size or change to the correct display mode?</p>

<p>Below is the code I use to initialise the full screen:</p>

<pre><code>            frame = new display();
            canvas = new Canvas();
            canvas.addKeyListener(this);
            frame.setUndecorated(true);
            frame.getContentPane().add(canvas);
            strategy = canvas.getBufferStrategy();
            environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
            device = environment.getDefaultScreenDevice();
            oldDisplay = device.getDisplayMode();
try {
            device.setFullScreenWindow(frame);
            newDisplay = new DisplayMode(1440, 900, 60, 60);
            device.setDisplayMode(newDisplay);
catch (Exception ex) { }
            canvas.requestFocus();
            canvas.setFocusTraversalKeysEnabled(false);
            frame.setVisible(true);
            canvas.createBufferStrategy(2);
            strategy = canvas.getBufferStrategy();
</code></pre>

<p>Display is just a direct extension of JFrame.</p>

<p>If I don't get this working I fail this module of my degree. Please stackoverflow don't fail me now! Thank you!</p>

<p>Edit: FIXED EXCEPTION however program seems to not be changing resolution at all despite setting things 800, 600, 60, 60.</p>
