if (imageId != -1) { imageList.setSelectedIndex(imageId); imageList.ensureIndexIsVisible(imageId); }
imageList.setSelectedIndex(initialIndex); imageList.ensureIndexIsVisible(initialIndex);
    public void queryImages() {        Vector listData = new Vector();        int curSlot = 0;        Enumeration ids = tileset.getImageIds();        imageIds = new Object[tileset.getTotalImages()];        for (int i = 0; i < imageIds.length; ++i) {            imageIds[i] = ids.nextElement();            Image img = tileset.getImageById(imageIds[i]);            // assert img != null;            listData.add(img);        }        imageList.setListData(listData);        if (imageId != -1) {            imageList.setSelectedIndex(imageId);            imageList.ensureIndexIsVisible(imageId);        }    }