String saveFolder = "C:\\"; Preferences pref = Preferences.userRoot().node( this.getClass().getName()); String lastPath = pref.get("lastPath", ""); JFileChooser fc = null; if (!lastPath.equals("")) { fc = new JFileChooser(lastPath); } else{ fc = new JFileChooser(saveFolder); } saveFolder = fc.getSelectedFile().getPath(); pref.put("lastPath",saveFolder);
JFileChooser记住上次选择的路径,布布扣,bubuko.com
原文:http://www.cnblogs.com/sosomaxba/p/3785910.html