0

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.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Bu Saeed
  • 1,173
  • 1
  • 16
  • 27

1 Answers1

2

When you mention the "Restore Down" button you mean following icon in a window's title bar:

window title bar: "Restore Down" button in Windows

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:

cursor shown when resize allowed

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:

hc_dev
  • 8,389
  • 1
  • 26
  • 38