Strange JFILECHOOSER behavior on Macs with ZIP files
I have a multiplatform GUI app that is running on Macs, linux and Windows computers. I distribute a data file that is a zipped up txt file. In windows the jfilechooser has no problem selecting the zip file. However, on macs I can't select the file. The dialog box greys out the open option and displays the zip file as a folder. You can open the folder but the program isn't designed to work that. It needs the zip file which is extracts the files from and uses the files.
Here is the code. Is there a property I'm not setting to allow the user to select the zip folder on a mac?
if (fileDialog == null) // (fileDialog is an instance variable)
fileDialog = new JFileChooser();
fileDialog.setDialogTitle("Select File for Reading");
fileDialog.setSelectedFile(null); // No file is initially selected.
int option = fileDialog.showOpenDialog(mainFrame);
// (Using "this" as a parameter to showOpenDialog() assumes that the
// readFile() method is an instance method in a GUI component class.)
if (option != JFileChooser.APPROVE_OPTION)
return null; // User canceled or clicked the dialog's close box.
File selectedFile = fileDialog.getSelectedFile();