Maximize a JFrameTag(s): Swing
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); } }
mail_outline
Send comment, question or suggestion to howto@rgagnon.com
Send comment, question or suggestion to howto@rgagnon.com