简体   繁体   中英

how to show all files of server using jfilechooser in java?

I want show all files of server using jfilechooser and choose any file then download that. But i don't know that, is it possible? Please give me some suggestion?

It's not easy but I think it's possible. You need to set a custom FileSystemView JFileChooser.setFileSystemView . Try to use google search (filesystemview ftp). Probably you can find implementation of FileSystemView which supports FTP.

You can make use of FileNameExtensionFilter . Using it you can add extensions for selection.

JFileChooser chooser = new JFileChooser();
FileNameExtensionFilter filter = new FileNameExtensionFilter("jpg", "gif");
chooser.setFileFilter(filter);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM