简体   繁体   中英

How to maximize JFrame

How to maximize JFrame while loading the form? I am using Netbeans 7.3.1 so I am unable to edit initComponents() auto generated code please suggest me any alternate way so that I can maximize my JFrame at start-up.

JFrame frame = new JFrame();
Rectangle bounds = getmaximizedBounds(); // set your maximized bounds
frame.setMaximizedBounds(bounds);
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);

Try this,

JFrame.setState(Frame.MAXIMIZED_BOTH)

read about frame states here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM