重複の可能性:
並べ替えられた ArrayList が表示されない?
コード:
String title1 = "Original Order\n\n";
String title2 = "Sorted Order\n\n";
String collection = "";
for (int i = 0; i < cdcollection.size(); i++) {
collection = collection + cdcollection.get(i);
}
mainTextArea.setText(title1 + collection);
Collections.sort(cdcollection);
String temp = "";
for (int j = 0; j < cdcollection.size(); j++) {
temp += cdcollection.get(j);
}
mainTextArea.setText(title2 + temp);