sets.setSelectedIndex(0);
sets.setSelectedIndex(prevIndex); if (sets.getSelectedIndex() == -1) { sets.setSelectedIndex(0); } pc.setTileset((TileSet) sets.getSelectedValue());
    public void setMap(Map map) {        Vector tilesets = new Vector();        currentMap = map;        if (currentMap != null) {            tilesets = currentMap.getTilesets();            pc.setTilesets(tilesets);            sets.setListData(tilesets);            sets.setSelectedIndex(0);        }    }