chooser.setFileFilter(byExtensionFilter);
    protected void showFileChooser()    {        // Start at the location of the most recently loaded map file        String startLocation = TiledConfiguration.node("recent").get("file0", "");        TiledFileFilter byExtensionFilter =                new TiledFileFilter(TiledFileFilter.FILTER_EXT);        TiledFileFilter tmxFilter =                new TiledFileFilter(TiledFileFilter.FILTER_TMX);        JFileChooser chooser = new ConfirmingFileChooser(startLocation);        chooser.addChoosableFileFilter(byExtensionFilter);        chooser.addChoosableFileFilter(tmxFilter);        chooser.setFileFilter(byExtensionFilter);        MapWriter[] writers = editor.getPluginLoader().getWriters();        for (int i = 0; i < writers.length; i++) {            try {                chooser.addChoosableFileFilter(new TiledFileFilter(writers[i]));            } catch (Exception e) {                e.printStackTrace();            }        }        int result = chooser.showSaveDialog(editor.getAppFrame());        if (result == JFileChooser.APPROVE_OPTION)        {            TiledFileFilter saver = (TiledFileFilter) chooser.getFileFilter();            String selectedFile = chooser.getSelectedFile().getAbsolutePath();            saveFile(saver, selectedFile);        }    }