I've created a frame and set it extended state to JFrame.MAXIMIZED_BOTH
. The window appears maximazed at startup, but after I pressed "Restore" button, it resizes to zero-sized window with only upper part, which contains minimize, maximize and close buttons. After that I can resize window manually, and the content is shown.
I want my window to be maximized at startup, but don't want to lose it after restore button click.
Here is the code:
public class MyFrame extends JFrame {
public MyFrame() {
//...
setExtendedState(getExtendedState() | JFrame.MAXIMIZED_BOTH);
setVisible(true);
}
}