当前所在位置:珠峰网资料 >> 计算机 >> 计算机等级考试 >> 正文
Java对话框获取目录、文件路径
发布时间:2010/6/30 11:02:11 来源:城市学习网 编辑:ziteng
  public File getFile(){
  final JFileChooser fc = new JFileChooser();
  fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
  //        JFileChooser.FILES_ONLY
  //        JFileChooser.DIRECTORIES_ONLY
  int returnVal = fc.showOpenDialog(this);
  File file_choosed = fc.getSelectedFile();
  return file_choosed;
  }
广告合作:400-664-0084 全国热线:400-664-0084
Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号
珠峰网 版权所有 All Rights Reserved