public TexturePackFilterDialog(final TexturepackPane instance) {
        super(LaunchFrame.getInstance(), true);
        this.instance = instance;
        setupGui();

        getRootPane().setDefaultButton(apply);

        int textures = TexturePack.getTexturePackArray().size();

        ArrayList<String> res = new ArrayList<String>();
        res.add(I18N.getLocaleString("MAIN_ALL"));
        for (int i = 0; i < textures; i++) {
            if (!res.contains(TexturePack.getTexturePack(i).getResolution())) {
                res.add(TexturePack.getTexturePack(i).getResolution());
            }
        }

        ArrayList<String> comp = new ArrayList<String>();
        comp.add(I18N.getLocaleString("MAIN_ALL"));
        for (int i = 0; i < textures; i++) {
            List<String> s = TexturePack.getTexturePack(i).getCompatible();
            for (String value : s) {
                if (!comp.contains(ModPack.getPack(value.trim()).getName())) {
                    comp.add(ModPack.getPack(value.trim()).getName());
                }
            }
        }

        compatiblePack.setModel(new DefaultComboBoxModel(comp.toArray(new String[comp.size()])));
        resolution.setModel(new DefaultComboBoxModel(res.toArray(new String[res.size()])));

        compatiblePack.setSelectedItem(instance.compatible);
        resolution.setSelectedItem(instance.resolution);

        apply.addActionListener(new ActionListener() {
            @SuppressWarnings("static-access")
            @Override
            public void actionPerformed (ActionEvent arg0) {
                instance.compatible = (String) compatiblePack.getSelectedItem();
                instance.resolution = (String) resolution.getSelectedItem();
                instance.updateFilter();
                setVisible(false);
            }
        });

        cancel.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed (ActionEvent e) {
                setVisible(false);
            }
        });

        search.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed (ActionEvent arg0) {
                SearchDialog sd = new SearchDialog(instance);
                sd.setVisible(true);
            }
        });
    }