Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
JFrame加载表单时如何最大化?我正在使用 Netbeans 7.3.1,所以我无法编辑initComponents()自动生成的代码,请建议我任何替代方式,以便我可以JFrame在启动时最大化我的代码。
JFrame
initComponents()
JFrame frame = new JFrame(); Rectangle bounds = getmaximizedBounds(); // set your maximized bounds frame.setMaximizedBounds(bounds); frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
尝试这个,
JFrame.setState(Frame.MAXIMIZED_BOTH)
在此处阅读有关帧状态的信息