文件选择器

具体代码:

    public class Method {
 public static String getSelectFile(){
  JFileChooser choose=new JFileChooser();
  choose.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
  choose.showDialog(new JLabel(), "选择");
  File file=choose.getSelectedFile();
  return file.getAbsolutePath();
 }

原文地址:https://www.cnblogs.com/haichaoweiwu/p/5895878.html