Presented below is a JFrame example that shows how to maximize it.

Java Code:
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);
  }
}