java - refreshing JTable doesn't show correctly data -
this function should refresh jtable:
list = null; list = (arraylist<string[]>) interface_engine.getdata(); info = new string[list.size()][header.length]; iterator = list.iterator(); (int = 0; < list.size(); i++) { string[] current = (string[]) it.next(); (int j = 0; j < header.length; j++) { info[i][j] = current[j]; } } defaulttablemodel model = (defaulttablemodel) data_table.getmodel(); model.addrow(info);
when call add new row (getdata remote method retrieve data db), added row it's not display string, a variable reference (such string@128dda...). where's problem?
the added row it's not display string, a variable reference (such string@128dda...).
read defaulttablemodel api. can't add 2-dimensional array using addrow() method. can add 1 row @ time.
the addrow() method should inside loop. build 1 row of data, invoke addrow() method.
Comments
Post a Comment