1st screen contains a text box, and a search button, so I need to enter a value, and I need to click the search button. After clicking the search button, it should display another screen, where it should contain a JTable with 5 colums, and 3 buttons (ADD, EDIT, DELETE).
1. I have to display some set of records in a table, table contains 5 columns, �result set� from the database may contain more records; it should display the values in the 5 columns for all the records.
2. From the JTable with the set of records, I can select a row, and click the ADD, EDIT, DELETE button, then it should display those values of the 5 columns for that particular row in text boxes in a new window, again it should contain 2 buttons, ok, cancel.
3. If I click on the ok button, first it should store in the database, and at the same time it should refresh the table contents with the new values.
I have done it but it is not working properly. What I did was, after displaying the values in the JTable, and then after clicking edit button, I am entering the values, it is updating the database, but, while to see the reflected values I need to do an Alt-Tab, and select the window, then only I am able to see the content otherwise I am not able to see the reflected contents.
As to your problem; it is probably a combination of the TableModel not calling it's fireTableChanged even and/or that event not being called on the Event Dispatching Thread. The reason you see the updates after you do your ALT-TAB thing is because bringing the table out of focus and back into focus repaints the table properly.
Are you using a TableModel for your data? If so, could you provide the code as well as the code for you Add/Edit/Delete events?