in console we can do that like this :
for(int i = 0 ; i <list.size();i++){
System.out.print("name :"+list.get(i).getName());
System.out.print(" year :"+list.get(i).getYear());
System.out.println();
}
if we know the size we can creat many label and do that
label.setText(“”);
what is the best way to do that in swing if we don’t know the size of our list ?
For tabular information, use a
JTable. See How to Use Tables for more details and code.Another tips: for command line output, look to Formatting Numeric Print Output.