Running the code below on JDK 1.6 correctly shows the window maximized across the whole screen. However when running on JDK 1.7 (update 6, build 13) the window is resized to given bounds instead of being maximized.
JFrame frame = new JFrame();
frame.setBounds(100, 300, 500, 500);
frame.setVisible(true);
frame.setExtendedState(frame.MAXIMIZED_BOTH);
Note that setting the extended state first and then making the main window visible fixes the problem.
http://netbeans.org/bugzilla/show_bug.cgi?id=214056