Hi ,
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.
Define "updating" the JTable? Are you updating the JTable's model? Because that's mainly what you need to do.
Rohit Kedia
Ranch Hand
Joined: Apr 24, 2010
Posts: 78
posted
0
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.