Hi, Nathan its been a long time since i wrote to you, and i hope you arent missing any of your last trains to your home. Coming to business, I would like to display a ResultSet in a JTable. How do i make the JTbale Non-Editable. Secondly the JTable does not get repainted/refreshed when i display the next ResultSet rather it is overlapped on the earlier displayed data. A sample code will be more appreciated.
Could you post the code related to the table that you already have? It is easier to just fix what is wrong and not worry about the rest of the things you already have that work.
Paul is right about overriding isCellEditable() to make your table non-editable... it sounds like the other problem you are having is due to either update problems, or problems with the renderers you are using for your table... without seeing code I am not sure which...
-Nate
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Hi Vaskar, Once you have your DataModel up and running ypou can stick in the methods you need to update the table the way you like. Your DataModel class should have a Vector of Vectors for data to allow you to add and remove data freely. Your data modification methods just modify the DataModel's data Vector according to your needs and then invoke a fireTableXXXChanged() call on the tablemodel to force the revalidating of the relevant cells - there are several of these to allow you to update parts or all the data as needed. Hope that helps,