How to select multiple files using java.awt.FileDialog

Is it possible to select multiple files using java.awt.FileDialog?

Since I want my dialog to have an OSX search interface, I cannot use JFileChooser.

+4
source share
3 answers

According to Javadoc, this is possible in JDK7 (see setMultipleMode(boolean) or getFiles() , which returns an array of files). However, cross validation with Javadoc for JDK6 is not possible in older versions ...

+5
source

You just need to set the parameters (default is false)

setMultiSelectionEnabled (true)

http://download.oracle.com/javase/7/docs/api/javax/swing/JFileChooser.html#setMultiSelectionEnabled(boolean )

+1
source

Here's another question that talks about how to make JFileChooser correct on OS-X, maybe this will help.

JFileChooser on OS-X

0
source

Source: https://habr.com/ru/post/1342130/


All Articles