List <String> cdList = new ArrayList();
Collections.addAll(cdList, "ExampleG","ExampleB","ExampleR","ExampleX");
bigBox.append("Original Order\n**************\n");
for (String s : cdList) {
bigBox.append(s);
bigBox.append("\n");
}
bigBox.append("\n\nSorted Order\n************\n");
for (String s : cdList) {
bigBox.append(s);
bigBox.append("\n");
}
リストをアルファベット順に整理し、「ソート順」の下に表示する必要がありますが、元の注文行の下で使用するために元の注文を保持する必要もあります。