How do you change the preferredSize() of a java program, after setVisible()? For example, you have a program that is 100x200, but when you click a button it changes to something else like 300x100.
Thanks in advance for any help.
How do you change the preferredSize() of a java program, after setVisible()? For example, you have a program that is 100x200, but when you click a button it changes to something else like 300x100.
Thanks in advance for any help.
Assuming you called setVisible method like this
And your button's click event name is myButtonActionPerformed, then this code will work: