Dear friends, I have problem in updating JTable. My program get i/p data for the table from other classes and tries to update the table. isCellEditable() is false, because I dont want user to type anything in my table. when the table data changes, it fires fireTabledatachanged() event. I am extending AbstractDataModel() class and my table data is stored in a hashtable. The data changes very fast. so to avoid flickering, I moved from applets to JApplet and I am using JTable. Is there anyother choice available for me? where to put the code for update in my (DataModel)class? setvalueat(row,col) is not possible for me, since I use hashtable. I cannot use arrays, since the datatypes are varying and the length of the table also grows dynamically. Thank u, Priya
mohana konakanchi
Ranch Hand
Joined: May 16, 2001
Posts: 67
posted
0
if your using hashtable, better make row and col number as key so that you can use setValueAt() public void setValueAt(Object value, int row, int col) { myHashTable.put(row+"-"+col,value); fireTableCellUpdated(row, col); } Other solutions depends on the way you implementing table model using hashtable. And what do you mean by dynamic table rows? Mohana