public Packer() {
        super("Pack-U-Like");

        saveChooser.setFileFilter(new FileFilter() {
            public boolean accept(File f) {
                if (f.isDirectory()) {
                    return true;
                }

                return (f.getName().endsWith(".png"));
            }

            public String getDescription() {
                return "PNG Images (*.png)";
            }

        });
        chooser.setMultiSelectionEnabled(true);
        chooser.setFileFilter(new FileFilter() {
            public boolean accept(File f) {
                if (f.isDirectory()) {
                    return true;
                }

                return (f.getName().endsWith(".png") || f.getName().endsWith(".jpg") || f.getName().endsWith(".gif"));
            }

            public String getDescription() {
                return "Images (*.jpg, *.png, *.gif)";
            }

        });

        sizes.addElement(Integer.valueOf(64));
        sizes.addElement(Integer.valueOf(128));
        sizes.addElement(Integer.valueOf(256));
        sizes.addElement(Integer.valueOf(512));
        sizes.addElement(Integer.valueOf(1024));
        sizes.addElement(Integer.valueOf(2048));
        sizes2.addElement(Integer.valueOf(64));
        sizes2.addElement(Integer.valueOf(128));
        sizes2.addElement(Integer.valueOf(256));
        sizes2.addElement(Integer.valueOf(512));
        sizes2.addElement(Integer.valueOf(1024));
        sizes2.addElement(Integer.valueOf(2048));

        JMenuBar bar = new JMenuBar();
        JMenu file = new JMenu("File");
        bar.add(file);
        JMenuItem save = new JMenuItem("Save");
        file.add(save);
        file.addSeparator();
        JMenuItem quit = new JMenuItem("Quit");
        file.add(quit);
        save.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                save();
            }

        });
        quit.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                System.exit(0);
            }

        });

        setJMenuBar(bar);
        JPanel panel = new JPanel();
        panel.setLayout(null);

        sheetPanel = new SheetPanel(this);
        JScrollPane pane = new JScrollPane(sheetPanel);
        pane.setBounds(5, 5, 530, 530);
        JScrollPane listScroll = new JScrollPane(list);
        listScroll.setBounds(540, 5, 200, 350);
        list.addListSelectionListener(new ListSelectionListener() {

            public void valueChanged(ListSelectionEvent e) {
                Object[] values = list.getSelectedValues();
                ArrayList sprites = new ArrayList();
                for (int i = 0; i < values.length; i++) {
                    sprites.add(values[i]);
                }

                list.removeListSelectionListener(this);
                select(sprites);
                list.addListSelectionListener(this);
            }

        });
        list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
        list.setCellRenderer(new FileListRenderer());
        panel.add(pane);
        panel.add(listScroll);

        JButton add = new JButton("Add");
        add.setFont(add.getFont().deriveFont(Font.BOLD));
        add.setMargin(new Insets(0, 0, 0, 0));
        add.setBounds(745, 5, 40, 30);
        panel.add(add);

        add.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                int resp = chooser.showOpenDialog(Packer.this);
                if (resp == JFileChooser.APPROVE_OPTION) {
                    File[] selected = chooser.getSelectedFiles();
                    for (int i = 0; i < selected.length; i++) {
                        try {
                            sprites.addElement(new Sprite(selected[i]));
                        } catch (IOException x) {
                            x.printStackTrace();
                            JOptionPane.showMessageDialog(Packer.this, "Unable to load: " + selected[i].getName());
                        }
                    }
                }
                regenerate();
            }

        });
        JButton remove = new JButton("Del");
        remove.setFont(add.getFont().deriveFont(Font.BOLD));
        remove.setMargin(new Insets(0, 0, 0, 0));
        remove.setBounds(745, 35, 40, 30);
        panel.add(remove);
        remove.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                Object[] selected = list.getSelectedValues();
                for (int i = 0; i < selected.length; i++) {
                    sprites.removeElement(selected[i]);
                }
                regenerate();
            }

        });

        JLabel label;

        label = new JLabel("Border");
        label.setBounds(540, 375, 200, 25);
        panel.add(label);
        border.setBounds(540, 400, 200, 25);
        panel.add(border);
        border.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent e) {
                regenerate();
            }

        });

        label = new JLabel("Width");
        label.setBounds(540, 425, 200, 25);
        panel.add(label);
        widths.setBounds(540, 450, 200, 25);
        panel.add(widths);
        widths.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                twidth = ((Integer) widths.getSelectedItem()).intValue();
                sheetPanel.setTextureSize(twidth, theight);
                regenerate();
            }

        });

        label = new JLabel("Height");
        label.setBounds(540, 475, 200, 25);
        panel.add(label);
        heights.setBounds(540, 500, 200, 25);
        heights.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                theight = ((Integer) heights.getSelectedItem()).intValue();
                sheetPanel.setTextureSize(twidth, theight);
                regenerate();
            }

        });

        panel.add(heights);

        twidth = 512;
        theight = 512;
        sheetPanel.setTextureSize(twidth, theight);
        widths.setSelectedItem(Integer.valueOf(twidth));
        heights.setSelectedItem(Integer.valueOf(theight));

        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        setContentPane(panel);
        setSize(800, 600);
        setResizable(false);
        setVisible(true);
    }