Vaishali Paramane
,
Ranch Hand
Aug 28, 2007 00:58:00
Hi I am working on B&S. I booked the record and its updated in file but it not dislapay in JTable after reading file. Can anyone know the solution Thanks in advace Vaishali
John Stone
,
Ranch Hand
Aug 28, 2007 01:17:00
I was thinking about this too, and come to 2 solutions. 1. repeat the last search 2. if there was no error while calling book(), update the table "blindly"
Vaishali Paramane
,
Ranch Hand
Aug 28, 2007 11:19:00
Hi I am also doing same things then also its not displaying updated record Following is my code: controller.update(recordNo,records); tableHandle = controller.find(criteria); addDataInTable(); Code in update method ArrayConvertIntoString writeRecord = new ArrayConvertIntoString(); int i=0; while(i<ContractorInfo.totalField){ writeRecord.write(data[i], ContractorInfo.lenghtOfField[i]); i++; } synchronized (database) { database.seek(ContractorInfo.offset + recordNo* ContractorInfo.totalLength + ContractorInfo.flagValue); database.write(recordValue.toString().getBytes()); } Anyone have any solustion for file refresh? Thanks Vaishali [ August 28, 2007: Message edited by: Vaishali Paramane ]
Sagar Salapaka
,
Greenhorn
Aug 28, 2007 14:27:00
Could it be as simple as not calling fireTableDataChanged() on the underlying table model? Sagar [ August 28, 2007: Message edited by: Sagar Salapaka ]
John Stone
,
Ranch Hand
Aug 28, 2007 14:31:00
Originally posted by Sagar Salapaka: Could it be as simple as not calling fireTableDataChanged() on the underlying table model? Sagar [ August 28, 2007: Message edited by: Sagar Salapaka ]
:-), looks like you are right,.. I didn't read the question carefully.
Vaishali Paramane
,
Ranch Hand
Aug 28, 2007 18:04:00
Originally posted by Sagar Salapaka: Could it be as simple as not calling fireTableDataChanged() on the underlying table model? Sagar [ August 28, 2007: Message edited by: Sagar Salapaka ]
Hi sagar thanks for replying. but I didnot get you what you means. I didnot impliment fireTableDataChanged() method. Please can you explain it. again thanks Vaishali
John Stone
,
Ranch Hand
Aug 28, 2007 23:34:00
Yo don't have to, it's already implemented in AbstractTableModel. When you update your model, just call this method and view will redraw. http://java.sun.com/javase/6/docs/api/javax/swing/table/AbstractTableModel.html#fireTableDataChanged() [ August 28, 2007: Message edited by: John Stone ]
Vaishali Paramane
,
Ranch Hand
Sep 05, 2007 16:05:00
HI I fired fireTableDataChanged on my tableHadler class public class TableHandle extends AbstractTableModel{ } then also my JTable doesnot showing updated record. Please can anyone help me. Thanks Vaishali
Jar Jaquiso
,
Greenhorn
Sep 06, 2007 00:58:00
Hello Vaishali, You may need to call repaint() on your JTable. Jar
John Stone
,
Ranch Hand
Sep 06, 2007 01:04:00
It should repaint after fireTableDataChanged() is called. Are you creating more than one JTable? I remember, that one rancher had similiar problem, because he created more than one JTable and they were stacked one on another. Are the Sun tutorials on JTable working ok?
Vaishali Paramane
,
Ranch Hand
Sep 06, 2007 13:12:00
Thanks My problem solved. Actually its giving exception thats why behind the code doesn't working. Thanks again for help Vaishali [ September 06, 2007: Message edited by: Vaishali Paramane ]
rubbery bacon. crispy tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com