Se conosci newPos e non curPos
così dovrebbe andare.codice:iterator = sortedList.listIterator(); int curPos = 0; Element tmpEl = (Element)sortedList.get(newPos); while (iterator.hasNext()) { image = (Element)iterator.next(); // se l'img all'interno della lista è quella che l'utente vuole spostare if (...) { curPos=iterator.nextIndex(); } }//end while sortedList.set(newPos,(Element)sortedList.get(curPos)); sortedList.set(curPos,tmpEl)

Rispondi quotando