|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectComponent
Container
JComponent
JFileChooser
JFileImageChooser
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.
The file formats offered by the dialog are a subset of those supported by
ImageIO
on the host system.
// Prompting for an input image file
File file = JFileImageChooser.showOpenFile();
if (file != null) {
...
}
// Prompting for a file name to save an image
File file = JFileImageChooser.showSaveFile();
if (file != null) {
...
}
Nested Class Summary |
---|
Nested classes/interfaces inherited from class JFileChooser |
---|
JFileChooser.AccessibleJFileChooser |
Nested classes/interfaces inherited from class JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class JComponent |
---|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Method Summary | |
---|---|
void |
approveSelection()
Validates the selected file name. |
static File |
showOpenFile()
Prompts for file name to read an image. |
static File |
showOpenFile(Component parent)
Prompts for file name to read an image. |
static File |
showOpenFile(Component parent,
File workingDir)
Prompts for file name to read an image. |
static File |
showSaveFile()
Prompts for file name to save an image. |
static File |
showSaveFile(Component parent)
Prompts for file name to save an image. |
static File |
showSaveFile(Component parent,
File workingDir)
Prompts for file name to save an image. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static File showSaveFile()
null
if the dialog was cancelledpublic static File showSaveFile(Component parent)
parent
- parent component (may be null
)
null
if the dialog was cancelledpublic static File showSaveFile(Component parent, File workingDir)
parent
- parent component (may be null
)workingDir
- the initial directory
null
if the dialog was cancelledpublic static File showOpenFile()
null
if the dialog was cancelledpublic static File showOpenFile(Component parent)
parent
- parent component (may be null
)
null
if the dialog was cancelledpublic static File showOpenFile(Component parent, File workingDir)
parent
- parent component (may be null
)workingDir
- the initial directory
null
if the dialog was cancelledpublic void approveSelection()
approveSelection
in class JFileChooser
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |