>When I maximize a JFrame that was created in the application, it hides
>the Windows taskbar.
Really? When I run this code on Windows, the
taskbar appears over the top of the bottom part
of the JFrame.
<sscce>
import java.awt.*;
import javax.swing.*;
class FullScreenFrame {
public static void main(String[] args) {
JFrame f = new JFrame("Big");
f.setDefaultCloseOperation(
JFrame.EXIT_ON_CLOSE);
f.setExtendedState(Frame.MAXIMIZED_BOTH);
f.setVisible(true);
}
}
</sscce>

Signature
Andrew Thompson
http://www.athompson.info/andrew/
"Goofball" <yuriytkach@gmail.com> 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.

Signature
Real Gagnon from Quebec, Canada
* Java, Javascript, VBScript and PowerBuilder code snippets
* http://www.rgagnon.com/howto.html
* http://www.rgagnon.com/bigindex.html