if (!out.getPath().endsWith("." + ext) && save)
if (!out.getPath().toLowerCase().endsWith("." + ext.toLowerCase()) && save)
    public static File getFile(final boolean save, final String ext,        final String desc)    {        JFileChooser jfc = new JFileChooser(AbstractRom.getDefaultDir());        jfc.setFileFilter(new SimpleFileFilter(save, ext, desc));        if ((save ? jfc.showSaveDialog(null) : jfc.showOpenDialog(null)) == JFileChooser.APPROVE_OPTION)        {            File out = jfc.getSelectedFile();            // extension is forced on save.            if (!out.getPath().endsWith("." + ext) && save)                out = new File(out.getPath() + "." + ext);            AbstractRom.setDefaultDir(out.getParent());            return out;        }        else        {            return null;        }    }