javax.swing.SwingUtilities.invokeLater(new ShowFileDialog());
}
public class ShowFileDialog implements Runnable {
public void run() {
JnexFileChooser chooser = DialogManager.getFileChooser(null);
if (getModel() instanceof DirNameModel) {
chooser.getJFileChooser().setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
} else {
chooser.getJFileChooser().setFileSelectionMode(JFileChooser.FILES_ONLY);
}
String fileName = null;
if (getModel().getText().length() > 2) {
fileName = new File(getModel().getFullName()).getPath();
} else if (getModel().getBrowseDirectory() != null) {
fileName = getModel().getBrowseDirectory().getText();
}
File theFile = chooser.popupOpenDialog(fileName);
if (theFile != null) {
getModel().setText(theFile.getAbsolutePath());
getModel().fireEditEvent(getModel(), DataModelEvent.VALUE_EDIT);
}
}