JFrame a = new JFrame();
a.setExtendedState(Frame.MAXIMIZED_BOTH);
a.show();
需要在jdk1.4中,可以这样实现,以前的版本不行

解决方案 »

  1.   

    我就是这么干的,可是还是不行,我的JDK是1.4,我是从JFrame继承了一个类,然后这么设置。这究竟是怎么回事?
      

  2.   

    Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
    frame.setSize(dim.width, (dim.height - 25));25为windows屏幕上工具栏的高度
      

  3.   

    原因可能是这样的:
      setExtendedState(int state)
      Note that if the state is not supported on a given platform, nothing will happen. The application may determine if a specific state is available via the java.awt.Toolkit#isFrameStateSupported(int state) method.