starting frame in maximized state using netbeans

I am trying to have my jframe start in a maximized state but haven't found it possible to insert the code this.setState(this.MAXIMIZED_BOTH);anywhere into netbeans to get the jframe to do so. any help would be greatly appreciated.
[259 byte] By [developprogramsa] at [2007-11-26 13:12:14]
# 1
You're using the gui editor aren't you? You should be able to put the code in the constructor of your class between initComponents(); and setVisible(true); Switch to the source view from the design view.
hunter9000a at 2007-7-7 17:28:56 > top of Java-index,Java Essentials,Java Programming...
# 2

I tried running this but it still doesn't work

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new notesApp().setExtendedState(JFrame.MAXIMIZED_BOTH);

new notesApp().setVisible(true);

}

});

}

any ideas, thanks

developprogramsa at 2007-7-7 17:28:56 > top of Java-index,Java Essentials,Java Programming...
# 3

new notesApp().setExtendedState(JFrame.MAXIMIZED_BOTH);

That creates a new Frame and sets the size, but doesn't show it.

new notesApp().setVisible(true);

That also creates a new Frame, but doesn't set the size before showing it.

Just create one new notesApp, and call both of those methods on it.

hunter9000a at 2007-7-7 17:28:56 > top of Java-index,Java Essentials,Java Programming...