I have a table which in the first column ,I have student's name.such as "Esfandyar Talebi","Arash Nouri" and the number of rows can be changed. and just 2 rows are filled from 4 rows.
the code that I have written:
List<String> professorsName = new ArrayList<String>();
for(int i=0;i<InformationTable.getRowCount();i++){
professorsName.add((String) InformationTable.getValueAt(i, 0));
System.out.println(professorsName.toString());
}
but it will show these things in the console:
[Esfandyar Talebi]
[Esfandyar Talebi, Arash Nouri]
[Esfandyar Talebi, Arash Nouri, null]
[Esfandyar Talebi, Arash Nouri, null, null]
[Esfandyar Talebi, Arash Nouri, null, null, null]
[Esfandyar Talebi, Arash Nouri, null, null, null, null]
null