⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 folderselected.java

📁 一个网络上传下载器
💻 JAVA
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package DownloadManager;import javax.swing.*;import javax.swing.filechooser.*;import java.io.*;import java.awt.*;/** *  a simple utility for select folder by showing a dialog * @author Administrator */public class FolderSelected {    private JFileChooser fc;    private String path;    private Component parent;        public FolderSelected(Component component)    {             this.parent=component;    }        public String getFolderPath()    {        //create a folder chooser         fc = new JFileChooser();            fc.setFileSelectionMode(1);            int returnVal = fc.showOpenDialog(parent);            if (returnVal == JFileChooser.APPROVE_OPTION) {                File file = fc.getSelectedFile();                path=file.getPath();            }        return path;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -