getFileChooser().setFileFilter((FileFilter) filter);
if (filter != null) { selected = filter; fireContentsChanged(this, -1, -1); }
    public void setSelectedItem(Object filter)    {      // change the filter in the file chooser and let the property change      // event trigger the change to the selected item      getFileChooser().setFileFilter((FileFilter) filter);    }