Hi,

I have a problem with showing data in JTable, and I'm using Netbeans 6.8. I have a little application where a user can store events in a specified genre. (no database, just write it in a file). So when it starts its showing a JCombobox with all the types of genres, and itís the goal to show the events related to that genre in a JTable when it starts. And off course buttons to add new events, but that already works fine.
Iíve writed a method ďtoonEvenementenĒ to try to show the events of the selected item of the JCombobox. I get the the good results, tested it with System.out.println.
But the problem I have is that I end up in a never ending loop, I thatís the part where it goes wrong. I donít understand it, it has to stop when it he has run over all the events of that type of genre, but he doesnít. Itís the second line of the for loop that brings the error.
Iíve put here my code for that specific method. I hope someone could help me. Thanks!

public class Hoofdscherm extends javax.swing.JFrame {
Ö
public void toonEvenementen(){
ArrayList<Evenement> evenementenLijst = new ArrayList<Evenement>();
String geselecteerdGenre = (String)cmbxGenres.getSelectedItem();
Genre g = o.getGenre(geselecteerdGenre);

try {
System.out.println(evenementenLijst.size());
}
catch (Exception e){
System.out.println("Er kunnen geen evenementen opgehaald worden, tabel blijft leeg");
}
for (int i=0; i<evenementenLijst.size(); i++) {
Evenement ev = o.getEvenementen(g).get(i);
g.voegEvenementToe(ev.getPlaats(), ev.getEvenement(), ev.getDatum(), ev.getPrijs());
System.out.println(ev.getPlaats()+" "+ ev.getEvenement()+" "+ ev.getDatum()+" "+ ev.getPrijs());
}
}
}
--------
public class Genre extends AbstractTableModel implements Serializable {

private String naam;
private ArrayList<Evenement> evenementen;
String[] columnNames = {"Plaats","Evenement","Datum","Prijs" };

public void voegEvenementToe(String pl, String e, String d, double pr) {
Evenement evenement = new Evenement(pl, e, d, pr);
evenementen.add(evenement);
Collections.sort(evenementen);
this.fireTableDataChanged();
}

public int getRowCount() {
if (evenementen == null) {
return 0;
}
else {
return evenementen.size();
}
}

public int getColumnCount() {
return columnNames.length;
}

@Override
public String getColumnName(int column) {
return columnNames[column];
}

public Object getValueAt(int rowOndex, int columnIndex) {
String terugkeerWaarde = null;
switch(columnIndex) {
case 0: terugkeerWaarde = " "+((evenementen.get(rowOndex))).getPlaats();
break;
case 1: terugkeerWaarde = " "+((evenementen.get(rowOndex))).getEvenement() ;
break;
case 2: terugkeerWaarde = " "+((evenementen.get(rowOndex))).getDatum();
break;
case 3: terugkeerWaarde = " "+((evenementen.get(rowOndex))).getPrijs();
break;
}
return terugkeerWaarde;
}
}