Im badly stuck with the GUI....after im updating my list from.. im calling repaint...but the repaint is not getting called then..its getting called some other time...and mostely my values are changed...
Is there a way..where i could decide the sequence in which "repaint" could be called...
I have one more problem...when i call firedatachanged...only 2 rows [according to the search] shows up and the rest of the portion goes blank..like in the GUI ..that looks really inconsistent....is there a way i could only remove the data without disturbin the GUI.
Thanx Inuka...my problem was callin the table with wrong instance....and u rightly pointed out...
I was just wondering that u are also giving the mcp C# test...so how is C# different from java ...even i wish to prepare for the test..could u give some advice.
For GD..
For Jtable you can only populate it with data of type objects. Now this fuction looks fine as I guess u play around with objects.
public void setValueAt(Object obj, int row, int column) { Object[] temp = (Object[]) this.records.get(row); temp[column] = obj; fireTableCellUpdated(row, column); }
// For this i see u have string array and u add it to records...to update u have to again add it to the data type object which u started with...
//method used to add record(s) to the table public void addContactor(String[] temp) { this.records.add(temp); //This does not work. Cannot clear the previous records fireTableDataChanged(); }
im tryin to update my jtables each time on a button click...i need thr table to clear of the old contents and put new one. But the problem is im not able to use firetablerowdeleted or any function similar to this..simply they dont work....could anybody advice me on this....
thanx for the info....actually what i meant when i said im searchin the table is im searchin the object[][]..which i feel is easier to seach instead of the DB....the problem I had doubt..is that can i call firetablecahnged from a method in class A.[if u remember that the jtable is in class B which is an inner class of Class A] Is this the correct method to update or am i doin wrong?
Actually i have extented the AbstractTableModel and need to call fireTableDataChanged() to update the table...but my problem is
I have a inner class A which has the frame , tables(this is a nested class B inside A) and buttons. For the first time..the values get loaded to the table (setValue function) from a randomAccessfile from the constructor B called by A.
Now for each time the search button is clicked..I want to get values from the table (use getValue function)..search relevant information and then need to diaplay only the search result. But all this on button event which is in the class A. So how do i call the fireTabDataChanged...if i call it in the button even handler as .fireTabledatChanged..it doesnt work....
the problem is im gettin lettle messed up how to update the Jtables. I can load the data in the jtable for the first time. Now after search I need only to show the search records in the jtable..the fields remain the same....
Thanx guys for all your help....Andrew it would be nice if you could help me with an ANT script of the project 2 version of Mehrams Habibis book...it would be really a good startin point for me...