[Advanced-java] How to maximize a JFrame

Matthew.Salerno@Gunter.AF.mil Matthew.Salerno at Gunter.AF.mil
Wed Apr 2 15:55:44 2003


I have been playing with the video card stuff lately, so you get my varied
answer.  Enjoy.


Here is the Maximize using the Video Card.
	import java.awt.GraphicsEnvironment;
	import java.awt.GraphicsDevice;
	import java.awt.DisplayMode;

	static final GraphicsEnvironment GRAPHICS_ENVIRONMENT =
GraphicsEnvironment.getLocalGraphicsEnvironment(); 
	static final GraphicsDevice GRAPHICS_DEVICE  =
GRAPHICS_ENVIRONMENT.getDefaultScreenDevice(); 
	GRAPHICS_DEVICE.setFullScreenWindow(this);

You can use this for slight effect of having a full screen app.
      setUndecorated(true); 
      GRAPHICS_DEVICE.setFullScreenWindow(this); 

To go all the way use this: 
	// (note, on window exit, be sure to set back to your original
settings)
	static final DisplayMode DEFAULT_DISPLAY_MODE = new DisplayMode(800,
600, 16, DisplayMode.REFRESH_RATE_UNKNOWN);
	static final GraphicsEnvironment GRAPHICS_ENVIRONMENT =
GraphicsEnvironment.getLocalGraphicsEnvironment(); 
	static final GraphicsDevice GRAPHICS_DEVICE  =
GRAPHICS_ENVIRONMENT.getDefaultScreenDevice(); 
	
      setUndecorated(true); 
      GRAPHICS_DEVICE.setFullScreenWindow(this);
    	if(Constants.GRAPHICS_DEVICE.isDisplayChangeSupported()) { 
      	Constants.GRAPHICS_DEVICE.setDisplayMode(DEFAULT_DISPLAY_MODE);

	}




-----Original Message-----
From: Alvin Wang [mailto:xwang@qtechservices.com] 
Sent: Wednesday, April 02, 2003 9:35 AM
To: advanced-java@lists.xcf.berkeley.edu
Subject: [Advanced-java] How to maximize a JFrame


Hi! I have another naive question: how to maximize a JFrame in code, just
like when the user click the maximize button on the upperright cornor of the
JFrame?

thanks!

Alvin

_______________________________________________
Advanced-java mailing list
Advanced-java@lists.xcf.berkeley.edu
http://lists.xcf.berkeley.edu/mailman/listinfo/advanced-java