Skip to content

Instantly share code, notes, and snippets.

@brian428
Created July 15, 2013 00:14
Show Gist options
  • Save brian428/5996720 to your computer and use it in GitHub Desktop.
Save brian428/5996720 to your computer and use it in GitHub Desktop.
def pickDirDialog = new JFileChooser(
dialogTitle: "Choose directory for the new application",
fileSelectionMode: JFileChooser.DIRECTORIES_ONLY,
approveButtonText: "Set directory for new application",
acceptAllFileFilterUsed: false
)
result = pickDirDialog.showSaveDialog()
if( result == JFileChooser.APPROVE_OPTION )
{
newApplicationPath = pickDirDialog.getSelectedFile()
}
else
{
throw new InvalidUserDataException( "You must choose the parent directory for the new application." )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment