public static boolean canMoveUp(JList list){
  boolean result;
  int[] indices;
  result=false;
  indices=list.getSelectedIndices();
  if (indices.length > 0) {
    if (indices[0] > 0)     result=true;
  }
  return result;
}

public static boolean canMoveUp ( JList list ) { boolean result ; int [ ] indices ; result = false ; indices = list . getSelectedIndices ( ) ; if ( indices . length > 0 ) { if ( indices [ 0 ] > 0 ) result = true ; } return result ; }
checks whether the selected items can be moved up
