Skip to main content

fullscreen JFrame doesnt hide windows taskbar

4 replies [Last post]
tommassino
Offline
Joined: 2007-10-17

I'm trying to run a application in fullscreen and I use win7. In fullscreen mode it draws a grey rectangle instead of the taskbar on the fullscreened JFrame (no icons on the bar etc, only a grey rect.). Anybody knows if I can get rid of this issue somehow?
Here's the code i use:

<br />
public class Fullscreen extends JFrame {<br />
	private Fullscreen () {<br />
		super("fullscreen");</p>
<p>		setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);</p>
<p>		GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();<br />
        	if(gd.isFullScreenSupported())<br />
        	{<br />
        		setUndecorated(true);<br />
	        	setResizable(false);<br />
	        	gd.setFullScreenWindow(this);<br />
	        	validate();<br />
        	} else {<br />
            		pack();<br />
            		setVisible(true);<br />
        	}<br />
	}<br />
}<br />

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
anthony_p
Offline
Joined: 2006-07-24

What version of Java do you use? Have you tried the latest 6 update release (like u20 or something newer)? What about an early access version of JDK 7 (b100 or newer)? Do they work correctly?

tommassino
Offline
Joined: 2007-10-17

Thanks for replying, I got the u20:
[code]
>java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
[/code]

PS: maybe could help: I override the paint method of the JFrame and draw a BufferedImage on the frame

Message was edited by: tommassino

anthony_p
Offline
Joined: 2006-07-24

I'm unable to reproduce it on my Win7 box (though I tried 6u18 and some latest 7 builds).

Could you please try other releases and see if the problem is still reproducible? This may be related to some GUI tweaking application installed on your PC, btw. Also, please try running on other Win7 PCs and see if it's reproducible there.

If the problem is persistent, please submit a bug report at http://bugs.sun.com/

PS. Sorry for the delayed reply.

tommassino
Offline
Joined: 2007-10-17

Found the bug, my fault... the bufferedimage canvas had wrong bounds:
[code]
Rectangle bounds = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
drawImage = new BufferedImage(bounds.width, bounds.height, BufferedImage.TYPE_INT_ARGB);
[/code]
but the getMaximumWindowBounds arent fullscreen bounds, getBounds gives correct bounds in fullscreen
thanks for help.

Message was edited by: tommassino