不需要为该文件选择对话框中的这个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) .....
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) .....
在java图形技术卷II上有非常专业的实现。