Problem Resizing The Monitor

I am having trouble with resizing the screen in this program where I use a buffered strategy to buffer my screen. Here's the problem area in my code:

GraphicsDevice <graphicsDevice> = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();

<displayMode> = new DisplayMode(1152, 864, DisplayMode.BIT_DEPTH_MULTI,DisplayMode.REFRESH_RATE_UNKNOWN);

if(graphDev.isDisplayChangeSupported())

{

<graphicsDevice.setDisplayMode(><displayMode>);

System.out.println("Was Changed");

}

<grapicsConfiguration> = graphDev.getDefaultConfiguration();

<Frame> = new Frame(graphs);

<Frame>.setUndecorated(true);

<Frame>.setIgnoreRepaint(true);

<Frame>.setResizable(false);

<Frame>.addKeyListener(this);

<Frame>.setSize(1152,864);

<graphicsDevice>.setFullScreenWindow(<Frame>);<--

<frame>.createBufferStrategy(2);

<bufferStrategy> = <Frame>.getBufferStrategy();

<graphics> = <bufferStrategy>.getDrawGraphics();

if(((int)maFrame.getHeight()) != 864 || ((int)maFrame.getWidth()) != 1152)

{

System.out.println("\nAn error occured in resizing your monitor's resolution.\nPlease manually set your screen resolution to (1152, 864),\nthen try running the game again.\n");

exit = true;

}

At the part where I put the arrow (<--), the frame is resized back down to whatever screen resolution the computer is at.

Is there any way around this?

Also, the displayMode I use resizes things correctly, since I get the output "Was Changed", yet the actual Frame is never resized by this. Can I fix my problem by changing something with this?

Thanks in advance for any help.

[1841 byte] By [Quagmire4444a] at [2007-11-27 5:32:25]
# 1
Uh.. you shouldn't be doing that, recode your program I suggest, that is also not very good OO.
btwallacea at 2007-7-12 14:58:30 > top of Java-index,Other Topics,Java Game Development...
# 2
Also next time use the code tags, but that's ok as it seems you are new to forums or something.Message was edited by: btwallace
btwallacea at 2007-7-12 14:58:30 > top of Java-index,Other Topics,Java Game Development...