可以用fileChooser.getSelectedFile获得选中的文件,然后向这个文件进行写操作。SAVE的名称和内容可以自己设定。看一下API,很简单的。

解决方案 »

  1.   

    不需要为该文件选择对话框中的这个SAVE按钮添加事件响应
    A typical process is like this:JFileChooser chooser = new JFileChooser();
    int returnVal = chooser.showSaveDialog(parent);
        if(returnVal == JFileChooser.APPROVE_OPTION) { //click SAVE button
           System.out.println("You chose to open this file: " +
                chooser.getSelectedFile().getName());
        }   //else if(returnVal ==JFileChooser.CANCEL_OPTION) .....
      

  2.   

    用线程
    在java图形技术卷II上有非常专业的实现。