Apopei Andrei Ionut Apopei Andrei Ionut - 1 month ago 10
Java Question

JFrame is very tiny when restore down is pressed

My question is why when I press to the restore down (on a Windows platform) the

JFrame
is very tiny (see the bellow screenshot).

I use this code regarding State of the JFrame:

this.setExtendedState(View.MAXIMIZED_BOTH);


I need to use
setMinimumSize()
?

enter image description here

Answer

Be sure that this.setExtendedState(JFrame.MAXIMIZED_BOTH) is executed AFTER setVisible(true). Also if you have a setResizable(false) call make sure it is executed AFTER the setExtendedState() one.

Comments