model.add(sel-1, model.remove(sel)); classpathEntryList.setSelectedIndex(sel-1);
for (int i = 0; i < selIndices.length; i++) { int sel = selIndices[i]; if ((sel-1) > lastInsertPos) { model.add( sel - 1, model.remove(sel)); selIndices[i] = sel - 1; } lastInsertPos = selIndices[i]; }  classpathEntryList.setSelectedIndices(selIndices);
    private void classpathUpButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_classpathUpButtonActionPerformed        int sel = classpathEntryList.getSelectedIndex();        if (sel <= 0)            return;            DefaultListModel model = (DefaultListModel)classpathEntryList.getModel();        model.add(sel-1, model.remove(sel));        classpathEntryList.setSelectedIndex(sel-1);    }//GEN-LAST:event_classpathUpButtonActionPerformed