(Automatically generated from BeanInfo)

Generated Object

A javax.swing.JFileChooser is returned, unless the user passes in a subclass of JFileChooser as the value argument, in which case the value argument is returned.

Attributes

Declared in javax.swing.JFileChooser

Declared in javax.swing.JComponent

Declared in java.awt.Container

Declared in java.awt.Component

Events

Declared in javax.swing.JFileChooser

Declared in javax.swing.JComponent

Declared in java.awt.Container

Declared in java.awt.Component

Content

Usage

Examples

Example of a dialog to choose .xls files:

import javax.swing.filechooser.FileFilter

def openExcelDialog  = fileChooser(dialogTitle:"Choose an excel file", 
                                   id:"openExcelDialog", fileSelectionMode : JFileChooser.FILES_ONLY, 
                                   //the file filter must show also directories, in order to be able to look into them
                                   fileFilter: [getDescription: {-> "*.xls"}, accept:{file-> file ==~ /.*?\.xls/ || file.isDirectory() }] as FileFilter) {
}
//later, in the controller
def fc = openExcelDialog
if(fc.showOpenDialog() != JFileChooser.APPROVE_OPTION) return //user cancelled
model.configFile = fc.selectedFile

Observable Attributes