I am using JDesktopPane, and I want it to be maximized when I load it. How can I do it?
Asked
Active
Viewed 3,525 times
1 Answers
0
Set the encompassing container's layout to BorderLayout and add the JDesktopPane to the CENTER. Then set the window to maximized.
JFrame f = new JFrame();
f.setLayout(new BorderLayout());
JDesktopPane jDesktopPane = new JDesktopPane();
f.add(jDesktopPane, BorderLayout.CENTER);
...
f.setExtendedState(MAXIMIZED_BOTH);

brian_d
- 11,190
- 5
- 47
- 72