I have a question with respect to JScrollPane
and a JTable
.
I have added a JTable
to a JScrollPane
, and added the JScrollPane
to the JPanel
. When I click on 'show' button, the JTable
will be filled with contents from the database.
I also have another button reset
, clicking on which will remove the contents of the JTable
, and the JScrollPane
. It is supposed to be doing that, but what happens is that, even after clicking the button, all the contents of the JTable
and the JScrollPane
still exists.
I used revalidate()
, reinstantiate()
, etc, but of no use. How do I make it work?