I am having a peculiar Issue in JTable.
I am using JTabbedPanes : In one Pane I can TextFields where I can Add User IDs and in the next Tab I have a JTable which shows list of users who have access(basically if I add in the Textfield any User ID that is saving in the Database and then I am updating the JTable).
But the problem is that the JTable is not getting updated.
I had checked and found that the data ; On clicking on any JTable cell I found that then only the Table it is showing updated value.
I have a JTable which is under a ScrollPane which is under a JPanel.
Every time a action is performed I am performing the following action to update a JTable.
Define "updating" the JTable? Are you updating the JTable's model? Because that's mainly what you need to do.
Joined: Apr 24, 2010
pete stein wrote:Define "updating" the JTable? Are you updating the JTable's model? Because that's mainly what you need to do.
Yes sir I am updating the Table Model.
In My Table Model class I have a List as a reference Whenever I am adding or deleting any data , I am fetching the updated Data from Database and passing the updated list to the Table Model.
Are you firing the appropriate events when you change the model? If you use / extended DefaultTableModel and are using addRow etc to change the model then the answer is yes - DefaultTableModel does all that for you.