public class FileChooserAction extends AbstractAction
Modifier and Type | Field and Description |
---|---|
protected File |
file
The file that was chosen.
|
protected FileFilter |
filter
A file filter to apply when browsing for a file.
|
protected boolean |
newFile
Indicates if you're browsing to create a new or an existing file.
|
protected Observable |
observable
An object that is expecting the result of the file chooser action.
|
enabled, changeSupport
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Constructor and Description |
---|
FileChooserAction(Observable observable,
String caption,
FileFilter filter,
boolean newFile)
Creates a new file chooser action.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent evt) |
File |
getFile()
Getter for the file.
|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
protected Observable observable
protected FileFilter filter
protected boolean newFile
protected File file
public FileChooserAction(Observable observable, String caption, FileFilter filter, boolean newFile)
observable
- the object waiting for you to select filecaption
- a description for the actionfilter
- a filter to apply when browsingnewFile
- indicates if you should browse for a new or existing filepublic File getFile()
public void actionPerformed(ActionEvent evt)
Copyright © 2015. All rights reserved.