Even the Restore down button in the title bar is disabled the user can still get the same behavior by double click on the title bar.
this.setResizable(false);
this.setExtendedState(JFrame.MAXIMIZED_BOTH);
I'm using Java 11 on Windows 10 if that matters.
CodePudding user response:
When you mention the "Restore Down" button you mean following icon in a window's title bar:
The setResizable(boolean)
method on a JFrame
simply enables or disables the user to resize it.
This means hovering with the mouse over the window's corners will either show or not show a double-headed resize-cursor like this:
Show the window maximized and disable resizing
The order of settings is important.
this.setExtendedState(JFrame.MAXIMIZED_BOTH);
this.setVisible(true);
this.setResizable(false);
See also: