1.使窗体位于屏幕中心 Dimension welcomeScreen=Toolkit.getDefaultToolkit().getScreenSize(); int x=(welcomeScreen.width-this.getSize().width)/2; int y=(welcomeScreen.height-this.getSize().height)/2; this.setBounds(x, y, 500, 400); 2.设置文件过滤器 private void jButton1