batchPanel.setSize(panelWidth, panelHeight);
batchPanel.setPreferredSize(new Dimension(panelWidth, panelHeight));
for (int i = 0; i < randomBatch.size(); i++) {
SimpleImage img = randomBatch.get(i).getPreview(3 * prefs.getTinaRenderPreviewQuality() / 4);
// add it to the main panel
ImagePanel imgPanel = new ImagePanel(img, 0, 0, img.getImageWidth());
imgPanel.setImage(img);
imgPanel.setLocation(BORDER_SIZE, i * IMG_HEIGHT + (i + 1) * BORDER_SIZE);
randomBatch.get(i).setImgPanel(imgPanel);
final int idx = i;
addRemoveButton(imgPanel, idx);
imgPanel.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent e) {
if (e.getClickCount() > 1 || e.getButton() != MouseEvent.BUTTON1) {
importFromRandomBatch(idx);
}
}