Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JFrame.setMaximumSize() doing nothing?

843806Oct 26 2008 — edited Oct 26 2008
I know this question has been posted many times, but I just can't find the answer...

So, how I set the max size of a frame?

A little test I made:

import java.awt.*;
import javax.swing.*;

class test
{
public static void main(String[] args)
{
JFrame test = new JFrame("test");
test.setMinimumSize(new Dimension(200,300)); // works
test.setMaximumSize(new Dimension(300,400)); // doesn't work
test.setDefaultCloseOperation(test.EXIT_ON_CLOSE);
test.show();
}
}

As you see, the result is that I cannot resize the frame under 200x300, but I'm able to resize it as large as I want, which is obviously wrong...
What am I missing?

Thanks in advance for the answers
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 23 2008
Added on Oct 26 2008
1 comment
298 views