public class DirectoryResource
extends java.lang.Object
DirectoryResource class allows the user to choose one or more files from a
directory (or folder) with a file selection dialog box by using the method
selectedFiles. These files can then be iterated over using a for loop.
Example usage:
DirectoryResource dr = new DirectoryResource();
for (File f : dr.selectedFiles()) {
ImageResource ir = new ImageResource(f);
ir.draw();
}
This software is licensed with an Apache 2 license, see http://www.apache.org/licenses/LICENSE-2.0 for details.
| Constructor and Description |
|---|
DirectoryResource()
Create a
DirectoryResource object. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Iterable<java.io.File> |
selectedFiles()
Open a file selection dialog box to allow the user to navigate to a directory and select one
or more files from the chosen directory (or folder).
|
public DirectoryResource()
DirectoryResource object.
Creating a DirectoryResource object does not open a dialog box for selecting
files.public java.lang.Iterable<java.io.File> selectedFiles()
Iterable that accesses the chosen files one at a time