JTABLE, new row for each unique name

hi i need help with my code.

in my database i have org_name which consist of "FCBC", "FCBC", "COOS", "FCBC". each has different date of booking.

i am doin summary page of each org_name with month increases depending on the booking.

in my table, it would only show FCBC with the three dates and one COOS with one date.

however, when i tried to do it, it only shows one FCBC with four dates (it includes COOS's date) instead of having two rows belonging to each FCBC and COOS.

ArrayList stringList = dao.retrieveAllBooking();

for (int i = 0; i < stringList.size(); i++){

ab = (AllBooking) stringList.get(i);

String org = (String)ab.getORG_NAME();

Org = org;//insert org into Organisation name column

ArrayList stringList1 =new ArrayList();

if(!stringList1.contains(org)){

stringList1.add(org);

}

d = ab.getDATE_OF_USE_TO();

ArrayList stringList2 =new ArrayList();

stringList2.add(d);

StringTokenizer ss =new StringTokenizer((String) d,"/");

String day = ss.nextToken();

String month = ss.nextToken();

String year = ss.nextToken();

if (month.equals("JAN")){

JanDR++;

}

if (month.equals("FEB")){

FebDR++;

}

if (month.equals("JUL")){

JulDR++;

}

}

Object[] data={Org,JanDR,FebDR,MarDR,AprDR,MayDR,JunDR,JulDR};

tableModel.addRow(data);

appreciate any kind of help!!

[2213 byte] By [KarenCWa] at [2007-11-27 11:23:35]
# 1

In the future Swing related questions should be posted in the Swing forum.

> tableModel.addRow(data);

Make sure you are creating a new data Vector for every row you want to add to the table model.

camickra at 2007-7-29 15:01:33 > top of Java-index,Java Essentials,Java Programming...