imageId = imageList.getSelectedIndex();
imageId = Integer.parseInt((String)imageIds[imageList.getSelectedIndex()]);
    public void valueChanged(ListSelectionEvent e) {        imageId = imageList.getSelectedIndex();        updateImageLabel();        updateEnabledState();    }