 <p>setExtendedState(JFrame.MAXIMIZED_BOTH); is not working is java 7</p> <p>You can try this code it works.</p> <pre><code> Toolkit tk = Toolkit.getDefaultToolkit(); int xSize = ((int) tk.getScreenSize().getWidth()); int ySize = ((int) tk.getScreenSize().getHeight()); setSize(xSize,ySize); </code></pre>