[Solved] How do I sort a List in Java? [closed]


Make your entity class implement Comparable<EtatCaution>.

public int compareTo(EtatCaution compareObject)
{
    return lbEtatCaution.compareTo(compareObject.lbEtatCaution);
}

Then, just call Collections.sort(myList).

8

solved How do I sort a List in Java? [closed]