I have noticed some strange behavior, which actually results from differences in the layout of a JFileChooser when using Mac OS X or Windows.
On my Mac the window looks like this:
Whereas on Windows it looks like the following:
My question is: is there any chance that I can simulate the Windows look on my Mac? Because I do not have a Windows computer, so I cannot test any changes, but always have to wait for somebody else to test it, which, of course, is painfully slow as it is only a matter of parameterization.
public DelimiterFileChooser(String[] comboChoices) {
comboBox = new JComboBox<>();
comboBox.setModel(new DefaultComboBoxModel<String>(comboChoices));
JPanel comboPanel = null;
if (os.indexOf("mac") >= 0 || os.indexOf("nix") >= 0 || os.indexOf("nux") >= 0 || os.indexOf("aix") > 0) {
comboPanel = (JPanel) this.getComponent(4);
comboPanel = (JPanel) comboPanel.getComponent(2);
} else {
comboPanel = (JPanel) this.getComponent(3);
comboPanel = (JPanel) comboPanel.getComponent(3);
}
Component c1 = comboPanel.getComponent(0);
Component c2 = comboPanel.getComponent(1);
comboPanel.removeAll();
comboPanel.add(getPanel(new JLabel("Use delimiter for .csv:"), comboBox));
comboPanel.add(c1);
comboPanel.add(c2);
}
For those who are interested, here is my code. I have found the Windows part in another Stack Overflow thread and initially wondered why it did not work on my Mac. Now that I know that obviously the dialogs are differently build on different OS systems, I stopped wondering, yet the suggested solution in the thread does not do the trick for me.
In case you want to run Windows on your OS-X machine, try Virtualbox, VmWare Fusion or Parallels. It makes running (multiple) Windows version easy on a Mac. To test the software.