Re: Taskbar hides when Swing GUI gets maximized
- From: Real Gagnon <realgag+usenet@xxxxxxxxxxxxx>
- Date: Wed, 11 Apr 2007 17:11:34 GMT
"Goofball" <yuriytkach@xxxxxxxxx> wrote in news:1176306362.928077.52620
@e65g2000hsc.googlegroups.com:
When I maximize a JFrame that was created in the application, it hides
the Windows taskbar. I am using default Swing Look and Feel decorated
windows. Anybody knows how the problem can be fixed? Thanks.
Try this :
import java.awt.*;
import javax.swing.*;
public class TestMaxJFrame extends JFrame {
public TestMaxJFrame() {
GraphicsEnvironment env =
GraphicsEnvironment.getLocalGraphicsEnvironment();
/*
The next line determines if the taskbar (win) is covered.
*/
this.setMaximizedBounds
(env.getMaximumWindowBounds()); // taskbar not covered
this.setExtendedState(this.getExtendedState() | this.MAXIMIZED_BOTH);
}
public static void main(String[] args) {
JFrame.setDefaultLookAndFeelDecorated(true);
TestMaxJFrame t = new TestMaxJFrame();
t.setVisible(true);
}
}
Bye.
--
Real Gagnon from Quebec, Canada
* Java, Javascript, VBScript and PowerBuilder code snippets
* http://www.rgagnon.com/howto.html
* http://www.rgagnon.com/bigindex.html
.
- References:
- Taskbar hides when Swing GUI gets maximized
- From: Goofball
- Taskbar hides when Swing GUI gets maximized
- Prev by Date: Taskbar hides when Swing GUI gets maximized
- Next by Date: Re: Calendar / Date / others classes should I use ?
- Previous by thread: Taskbar hides when Swing GUI gets maximized
- Index(es):
Relevant Pages
|