• Post Reply Bookmark Topic Watch Topic
  • New Topic

issue with replacing old data with new data when submit button is clicked for the second time  RSS feed

 
Siddharth Polisiti
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have created a gui which accepts username in the text field and once clicking on submit button it fetches user details and throws it on gui via JTable.
But when i click submit for the second time using different username the background process goes well and good the vector that i pass to jtable changes with new data but the values in gui still contain the old data.


Can some please help me with this.

Thanks in advance.

Regards,
Siddharth
 
R. Ramage
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the code you're using?
 
Rob Camick
Ranch Hand
Posts: 2801
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably because you are creating a new JTable component but are not adding the new table to the GUI.

The easier solution is do just create a new TableModel. Then you just use:



and the existing table will be updated automatically.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!