fileDialog.show(contentPane);
JOptionPane.showMessageDialog(contentPane, "Selected file: " + fileDialog.getSelectedFileName());
return;
}
if(directoryRadioButton.isSelected()) {
JDirectoryDialog directoryDialog = new JDirectoryDialog();
directoryDialog.show(contentPane);
JOptionPane.showMessageDialog(contentPane, "Selected directory: " + directoryDialog.getSelectedDirectory());
return;
}
if(customizedDirectoryRadioButton.isSelected()) {
JDirectoryDialog directoryDialog = new JDirectoryDialog();
directoryDialog.setTitle("This is a GREAT dialog!");
directoryDialog.setMessage("Choose a directory NOW!");
directoryDialog.show(contentPane);
JOptionPane.showMessageDialog(contentPane, "Selected directory: " + directoryDialog.getSelectedDirectory());
return;
}
}
});
buttonPanel.add(showDialogButton, cons);