aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JFrame maximized, display taskbar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JFrame maximized, display taskbar" Watch "JFrame maximized, display taskbar" New topic
Author

JFrame maximized, display taskbar

Matti Poro
Ranch Hand

Joined: Dec 03, 2005
Posts: 41
How do I set a JFrame maximized so that it won't hide the taskbar?
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
either of these don't hide the taskbar for me

frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
(or setExtendedState(MAXIMIZED_BOTH) if extending JFrame)

or

Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
frame.setSize(dim.width,dim.height); (or just setSize(dim.width,dim.height))
(this way ensure there is no setLocation() in your code)
Matti Poro
Ranch Hand

Joined: Dec 03, 2005
Posts: 41
Hmm, both ways hide the taskbar on my Windows XP.
Matti Poro
Ranch Hand

Joined: Dec 03, 2005
Posts: 41
I solved it.



This makes it to take the whole screen. It doesn't do that if I remove the setDefaultLookAndFeelDecorated(true).
 
 
subject: JFrame maximized, display taskbar