简体   繁体   中英

Why doesn't the method “setMaximumSize” work although “setMinimumSize” does?

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

public class MyClass {

   public static void main(String args[]) {
       JFrame myFrame = new JFrame();

       myFrame.setSize(new Dimension(500, 500));
       myFrame.setMinimumSize(new Dimension(300, 300));
       myFrame.setMaximumSize(new Dimension(800, 800));

       myFrame.setVisible(true);
       myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

   }

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM