|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectJFileImageChooser
public class JFileImageChooser
A file chooser dialog for common raster image format files. It provides static methods to display the dialog for opening or saving an image file with basic validation of user input.
// Prompting for an input image file
File file = JFileImageChooser.showOpenFile(null);
if (file != null) {
...
}
// Prompting for a file name to save an image
File file = JFileImageChooser.showSaveFile(null);
if (file != null) {
...
}
The file formats offered by the dialog are a subset of those supported by
ImageIO
on the host system.
JFileDataStoreChooser
,
JParameterListWizard
,
ImageIO
Constructor Summary | |
---|---|
JFileImageChooser(Shell parent,
int style)
|
|
JFileImageChooser(Shell parent,
int style,
File workingDir)
Create a new image file chooser |
Method Summary | |
---|---|
FileDialog |
getFileDialog()
|
static File |
showOpenFile(Shell parent)
Display a dialog to choose an image file to open |
static File |
showOpenFile(Shell parent,
File workingDir)
Display a dialog to choose an image file to open |
static File |
showSaveFile(Shell parent)
Display a dialog to choose a file name to save an image to |
static File |
showSaveFile(Shell parent,
File workingDir)
Display a dialog to choose a file name to save an image to |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JFileImageChooser(Shell parent, int style)
public JFileImageChooser(Shell parent, int style, File workingDir)
workingDir
- the initial directory to displayMethod Detail |
---|
public FileDialog getFileDialog()
public static File showSaveFile(Shell parent)
parent
- parent component (may be null
)
null
if the dialog was cancelledpublic static File showSaveFile(Shell parent, File workingDir)
parent
- parent component (may be null
)workingDir
- the initial directory to display
null
if the dialog was cancelledpublic static File showOpenFile(Shell parent)
parent
- parent component (may be null
)workingDir
- the initial directory to display
null
if the dialog was cancelledpublic static File showOpenFile(Shell parent, File workingDir)
parent
- parent component (may be null
)workingDir
- the initial directory to display
null
if the dialog was cancelled
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |