文件选择器

具体代码:

    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();
 }

posted @ 2016-09-22 12:56  PIAOYUJIJIE  阅读(258)  评论(0编辑  收藏  举报