Java Reference
In-Depth Information
Table 9-10.
JFileChooser Properties
Property Name
Data Type
Access
acceptAllFileFilter
FileFilter
Read-only
acceptAllFileFilterUsed
boolean
Read-write bound
accessibleContext
AccessibleContext
Read-only
accessory
JComponent
Read-write bound
actionListeners
ActionListener[ ]
Read-only
approveButtonMnemonic
char
Read-write bound
approveButtonText
String
Read-write bound
approveButtonToolTipText
String
Read-write bound
choosableFileFilters
FileFilter[ ]
Read-only
controlButtonsAreShown
boolean
Read-write bound
currentDirectory
File
Read-write bound
dialogTitle
String
Read-write bound
dialogType
int
Read-write bound
directorySelectionEnabled
boolean
Read-only
dragEnabled
boolean
Read-write
fileFilter
FileFilter
Read-write bound
fileHidingEnabled
boolean
Read-write bound
fileSelectionEnabled
boolean
Read-only
fileSelectionMode
int
Read-write bound
fileSystemView
FileSystemView
Read-write bound
fileView
FileView
Read-write bound
multiSelectionEnabled
boolean
Read-write bound
selectedFile
File
Read-write bound
selectedFiles
File[ ]
Read-write bound
UI
FileChooserUI
Read-only
UIClassID
String
Read-only
When the different
showDialog()
methods are used, the
dialogType
property is automati-
cally set to one of three
JOptionPane
constants:
OPEN_DIALOG
,
SAVE_DIALOG
,
CUSTOM_DIALOG
. If
you're not using
showDialog()
, you should set this property according to the type of dialog box you
plan to work with. The
controlButtonsAreShown
property allows you to hide the Open, Save,
and Cancel buttons.