If your window is a subclass of Frame, you can use this method:
setExtendedState(int state)
where state is the state of the frame, you must use the value MAXIMIZE_BOTH.
Try this example:
public class MaximizedFrame {
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.pack();
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
frame.setVisible(true);
}
}
Good Luck!