• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable content vanishes

 
Sivaraman Lakshmanan
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai all,
I wrote a application, where when u give any select query, the data is fetched and displayed in Jtable.
I fetch the data from the Database for the particular query and I store it in a 2 dimension array and use the JTables constructor
JTable table = new JTable(obj[],obj[][]);
Everything is fine when I fetch data for the first time. when I give a select query for the second time the data are fetched and displayed but if I do anything like minimize the window or do a mouse click, all the data got by the second query are lost and I can see only the data of the first query.
Why is this happening. anybody please help me.
Thanking you,
L.sivaraman.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, did you remove the first JTable from its container? Did you call validate() on the container after removing the old table (or the old JScrollPane) and adding the new one? It sounds like what's happening is that you're ending up with both the old and new tables in your GUI.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!