The problem is that the `File` object returned by `JFileChooser` has incomplete file name. To be more exact it returns the file name without the file extension part. I have tried retrieving the path using `getPath`, `getAbsolutePath` and `getCanonicalPath` but it still returns same path without the extension part. Same program and code work fine on Windows, Linux, and OSX 10.6 

The issue occurs on OSX 10.7.4 with Java SE 10.6.0\_33-b03-424. Does anyone know a work-around for this, or can at least confirm this happening?

Edit:

```
JFileChooser myImageChooser = new JFileChooser();
myImageChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
int val = myImageChooser.showDialog(NewJFrame.this, "Select Image");

        JFileChooser myImageChooser = new JFileChooser();
        myImageChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        int val = myImageChooser.showDialog(NewJFrame.this,
                "Select Image");

        if (val == JFileChooser.APPROVE_OPTION) {
            File f = myImageChooser.getSelectedFile();
            System.err.println(myImageChooser.getSelectedFile().getAbsolutePath());
            try {
                System.err.println(myImageChooser.getSelectedFile().getCanonicalPath());
            } catch (IOException ex) {
                Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
            }
            System.err.println(myImageChooser.getSelectedFile().getName());
            System.err.println(myImageChooser.getSelectedFile().getPath());

            //loadImage(f);
            //Util.event("LoadImage", f.getName());
        }

```

Also I just noticed something very interesting, that it works correctly for some files, same files that have visible extension in Finder, but for those that Finder doesn't show extension this fails. I have checked that the files actually have extensions by doing `ls` in bash terminal.

Edit 2:

After turning on 'Show all filename extensions' in Finder JFileChooser started to return file names with extension. That looks like a design error in JFileChooser's underlying implementation. And that doesn't really help to solve the problem since in my case this is a consumer product targeted for average users.