private void initSpritePanel() {
        File path = new File(Preference.getSpriteLocation());
        path.mkdirs();
        List<SpritePackage> packages = new ArrayList<SpritePackage>();
        File[] dirs = path.listFiles();
        for (int i = 0; i < dirs.length; i++) {
            File dir = dirs[i];
            if (!dir.isDirectory()) continue;
            String d = dir.getName();
            String name = d;
            File f = new File(dir, "info.txt");
            if (f.exists()) {
                try {
                    BufferedReader reader = new BufferedReader(new FileReader(f));
                    String line;
                    while ((line = reader.readLine()) != null) {
                        line = line.trim();
                        if (line.startsWith("name")) {
                            name = line.split("=")[1].trim();
                        }
                    }
                    reader.close();
                } catch (Exception e) {

                }
            }
            SpritePackage pack = new SpritePackage(name, d);
            packages.add(pack);
        }
        String[] packs = Preference.getSpriteDirectories();
        for (int i = 0; i < packs.length; i++) {
            for (SpritePackage p : packages) {
                if (p.getDir().equals(packs[i])) p.m_order = i;
            }
        }
        Collections.sort(packages, new Comparator<SpritePackage>() {
            public int compare(SpritePackage o1, SpritePackage o2) {
                return new Integer(o1.m_order).compareTo(new Integer(o2.m_order));
            }
        });
        lstPackages.setModel(
                new DefaultComboBoxModel(packages.toArray(new SpritePackage[packages.size()])));
        cmbSpriteDefaults.setModel(new DefaultComboBoxModel(SpriteLink.values()));
    }