Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • keyPressed (KeyEvent) - part of KeyListener
  • keyReleased (KeyEvent) - part of KeyListener
  • keyTyped (KeyEvent) - part of KeyListener
  • componentHidden (ComponentEvent) - part of ComponentListener
  • componentMoved (ComponentEvent) - part of ComponentListener
  • componentResized (ComponentEvent) - part of ComponentListener
  • componentShown (ComponentEvent) - part of ComponentListener
  • hierarchyChanged (HierarchyEvent) - part of HierarchyListener
  • mouseClicked (MouseEvent) - part of MouseListener
  • mouseEntered (MouseEvent) - part of MouseListener
  • mouseExited (MouseEvent) - part of MouseListener
  • mousePressed (MouseEvent) - part of MouseListener
  • mouseReleased (MouseEvent) - part of MouseListener
  • mouseDragged (MouseEvent) - part of MouseMotionListener
  • mouseMoved (MouseEvent) - part of MouseMotionListener
  • propertyChange (PropertyChangeEvent) - part of PropertyChangeListener
  • ancestorMoved (HierarchyEvent) - part of HierarchyBoundsListener
  • ancestorResized (HierarchyEvent) - part of HierarchyBoundsListener
  • focusGained (FocusEvent) - part of FocusListener
  • focusLost (FocusEvent) - part of FocusListener
  • mouseWheelMoved (MouseWheelEvent) - part of MouseWheelListener
  • caretPositionChanged (InputMethodEvent) - part of InputMethodListener
  • inputMethodTextChanged (InputMethodEvent) - part of InputMethodListener

Content

Usage

Examples

Example of a dialog to choose .xls files:

Code Block

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

  • acceptAllFileFilterUsed
  • accessory
  • alignmentX
  • alignmentY
  • approveButtonMnemonic
  • approveButtonText
  • approveButtonToolTipText
  • background
  • border
  • component
  • componentCount
  • componentPopupMenu
  • components
  • containerListeners
  • controlButtonsAreShown
  • currentDirectory
  • dialogTitle
  • dialogType
  • enabled
  • fileFilter
  • fileHidingEnabled
  • fileSelectionMode
  • fileSystemView
  • fileView
  • focusCycleRoot
  • focusTraversalKeys
  • focusTraversalPolicy
  • focusTraversalPolicyProvider
  • focusTraversalPolicySet
  • focusable
  • font
  • foreground
  • inheritsPopupMenu
  • inputVerifier
  • insets
  • layout
  • maximumSize
  • minimumSize
  • multiSelectionEnabled
  • opaque
  • preferredSize
  • selectedFile
  • selectedFiles
  • transferHandler
  • verifyInputWhenFocusTarget