[Advanced-java] How to maximize a JFrame
Alvin Wang
xwang at qtechservices.com
Wed Apr 2 16:36:39 2003
Matthew, your solutions looks promising. However, when I try
1. isFullScreenSupported() returns true
2. setFullScreenWindow(frame) looks like only simulated by resizing the
window to the size of the screen and positioning it at (0,0). (I still can
click the max button the "max" the window)
3. after setFullScreenWindow(frame), isDisplayChangeSupported() returns
true.
4. HOWEVER, the window seems have repaint problem! It does not refresh well
and sometimes freezes.
Any ideas? Thanks!
> -----Original Message-----
> From: advanced-java-bounces@lists.xcf.berkeley.edu
> [mailto:advanced-java-bounces@lists.xcf.berkeley.edu]On Behalf Of
> Matthew.Salerno@Gunter.AF.mil
> Sent: Wednesday, April 02, 2003 10:56 AM
> To: xwang@qtechservices.com; advanced-java@lists.xcf.berkeley.edu
> Subject: RE: [Advanced-java] How to maximize a JFrame
>
>
> 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
> _______________________________________________
> Advanced-java mailing list
> Advanced-java@lists.xcf.berkeley.edu
> http://lists.xcf.berkeley.edu/mailman/listinfo/advanced-java