登录
首页 » 其他 » Java生成一个文件打开的文件选择对话框窗口

Java生成一个文件打开的文件选择对话框窗口

于 2022-11-18 发布 文件大小:13.05 kB
0 190
下载积分: 2 下载次数: 1

代码说明:

Java生成一个文件打开的文件选择对话框窗口,和Win系统的浏览文件窗口相似,使用Java代码模拟实现的窗口程序,相关代码如下:   button.addActionListener(new ActionListener() { //按钮事件处理   public void actionPerformed(ActionEvent e) {   int state; //文件选择器返回状态   chooser.removeChoosableFileFilter(chooser.getAcceptAllFileFilter()); //移去所有文件过滤器   chooser.addChoosableFileFilter(new MyFileFilter("gif","图像文件")); //增加文件过滤器,接爱gif文件   if (comboBox.getSelectedIndex()==0) //组合框为"打开"    state=chooser.showOpenDialog(null); //显示打开文件对话框   else    state=chooser.showSaveDialog(null); //显示保存文件对话框   File file = chooser.getSelectedFile(); //得到选择的文件

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • FLASH游戏<接元宝>.现在上传给大家,一起交流学习.
    FLASH游戏.现在上传给大家,一起交流学习.-FLASH game . From now to everyone, with the exchange of learning.
    2022-08-22 18:56:07下载
    积分:1
  • A variety of time
    各种时频分析工具包part4,非常有用的!忘了是哪位大哥发的,现转发到这,希望对大家有所帮助!-A variety of time-frequency analysis tool kit part4, very useful! Forgot who made Big Brother, it is forwarded to it, and they hope to be helpful to everyone!
    2022-08-21 20:19:32下载
    积分:1
  • ct952源代码
    ct952 source code use for Digital Frame Photo
    2023-06-23 14:55:05下载
    积分:1
  • maze of algorithm (priority superior breadth and depth of talents
    迷宫问题的算法(优于广度优先,深度优-maze of algorithm (priority superior breadth and depth of talents
    2023-08-08 07:35:03下载
    积分:1
  • 实用光线追踪
    实用的二维动力射线追踪软件seis88最新版本,就是输入格式有点麻烦。非常适合模型正演。-Practical ray tracing of two-dimensional dynamic seis88 the latest version of software is a bit cumbersome input format. Very suitable for forward modeling.
    2022-11-17 07:15:03下载
    积分:1
  • protues仿真基于DS1820多点粮食监控,液晶显示检测到的温度
    protues仿真基于DS1820多点粮食监控,液晶显示检测到的温度-protues simulation based on DS1820 more food monitoring, LCD temperature detected
    2022-01-26 05:20:02下载
    积分:1
  • 学生成绩管理源代码!!!使用微软新技术c#编写的
    学生成绩管理源代码!!!使用微软新技术c#编写的-Student achievement management of source code! ! ! New technologies using Microsoft c# Prepared
    2022-04-07 06:13:31下载
    积分:1
  • 餐饮管理系统
      本系统有三种操作权限,其中,营业员只可以执行开台、点菜、买单及查询日收入操作;领班可以执行开台、点菜、买单、进货、添加新员工、日收入及月收入查询等操作;经理具有最高权限,除了领班及营业员的操作权限外,还可以设置员工权限、添加商品信息及菜式信息、备份与恢复数据库及初始化数据等操作。
    2023-09-02 15:20:05下载
    积分:1
  • based on the photographic measurement of the approximate vertical aerial photogr...
    基于vc++的有关摄影测量中近似垂直摄影情况下空中后方交会求解的源代码-based on the photographic measurement of the approximate vertical aerial photography Resection Solving the source code
    2022-07-16 01:38:43下载
    积分:1
  • 主要用于排队仿真,用的是MATLAB语言,希望能和大家分享。
    主要用于排队仿真,用的是MATLAB语言,希望能和大家分享。-Mainly used in queuing simulation, using the MATLAB language, want to share with you all.
    2022-01-26 00:56:02下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载