有,我是这样做的:
Point loc = getLocation();
dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height -     dlgSize.height) / 2 + loc.y);
dlg为你要显示的窗口类实例

解决方案 »

  1.   

    这是JB自动产生的代码
    作用是使窗口居中
        //Center the window
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension frameSize = frame.getSize();
        if (frameSize.height > screenSize.height) {
          frameSize.height = screenSize.height;
        }
        if (frameSize.width > screenSize.width) {
          frameSize.width = screenSize.width;
        }
        frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
        frame.setVisible(true);
      

  2.   

    to :nodreamer(无梦) 
    你的方法很好!!!
    请问你用的是jbuilder几?
      

  3.   

    每个版本都是吧!
    我知道从JB4都可以了吧!
    APPLET、APPLICATION都可以呀!
    给分呀!