Maximizing windows in Java Swing
2007.05.22 10am
JFrame frame = new JFrame(); // add all components frame.pack(); frame.setExtendedState(JFrame.MAXIMIZED_BOTH); frame.setVisible(true);
The key here is that you must call setExtendedState after any pack() methods, else it has no effect and you’ll spend two hours searching google and cursing Swing…trust me on this.
2 Comments
Jump to comment form | comments rss [?] | trackback uri [?]