我想使用groovy swing builder的fileChooser沒有運氣。 當我從複製常規網站下面的例子:Groovy Swing buider fileChooser
def openExcelDialog = SwingBuilder.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) {
}
但我得到一個錯誤信息:
groovy.lang.MissingMethodException: No signature of method: static groovy.swing.SwingBuilder.fileChooser() is applicable for argument types: (java.util.LinkedHashMap, ConsoleScript19$_run_closure1) values