sp.setPreferredSize(new Dimension(150, 150));
    private JPanel createImagePanel()    {        imageList = new JList();        imageList.setCellRenderer(new ImageCellRenderer());        imageList.setLayoutOrientation(JList.HORIZONTAL_WRAP);        imageList.addListSelectionListener(this);        JScrollPane sp = new JScrollPane();        sp.getViewport().setView(imageList);        // Buttons        bAddImage = new JButton("Add Image");        bAddImage.addActionListener(this);        bDeleteImage = new JButton("Delete Image");        bDeleteImage.addActionListener(this);        bDeleteAllUnusedImages = new JButton("Delete Unused Images");        bDeleteAllUnusedImages.addActionListener(this);        JPanel buttons = new VerticalStaticJPanel();        buttons.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));        buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));        buttons.add(bAddImage);        buttons.add(bDeleteImage);        buttons.add(bDeleteAllUnusedImages);        JPanel mainPanel = new JPanel();        mainPanel.setLayout(new GridBagLayout());        mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));        GridBagConstraints c = new GridBagConstraints();        c.fill = GridBagConstraints.BOTH;        c.weightx = 1; c.weighty = 1;        mainPanel.add(sp, c);        c.weightx = 0; c.weighty = 0; c.gridy = 1;        mainPanel.add(buttons, c);        return mainPanel;    }