We use cookies to collect and analyze information on site performance and usage,
to provide social media features and to enhance and customize content and advertisements.
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
if unremarked, the task will not be covered by
the maximized JFRAME.
*/
// this.setMaximizedBounds(env.getMaximumWindowBounds());
this.setExtendedState(this.getExtendedState() | this.MAXIMIZED_BOTH);
}
public static void main(String[] args) {
JFrame.setDefaultLookAndFeelDecorated(true);
TestMaxJFrame t = new TestMaxJFrame();
t.setVisible(true);
}
}