为什么“setMaximumSize”方法不起作用“setMaximumSize”?

时间:2010-11-03 18:33:11

标签: java swing

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);

   }

}

1 个答案:

答案 0 :(得分:7)