Deleting/Hiding JTable

I have a program in which I create a JTable with the Default table model. What i want is this;When the user clicks the "Clear" Button, I would like to do either of the following:1. Delete the JTable2. Hide the JTableThank you in advance for your help.
[286 byte] By [oc084a] at [2007-11-27 2:03:03]
# 1
Can anyone help? Please?
oc084a at 2007-7-12 1:44:59 > top of Java-index,Java Essentials,Java Programming...
# 2
If you JTable is called "table", for example, try this:table.setVisible(false);If you table is within a scrollpane, use the setVisible(false) method of the scrollpane
Nemesish3da at 2007-7-12 1:44:59 > top of Java-index,Java Essentials,Java Programming...
# 3
where are you having problems? :D
Redxxiva at 2007-7-12 1:44:59 > top of Java-index,Java Essentials,Java Programming...
# 4

I have a JPanel on which I have put a JTable w/ JScrollPane. What I would like is when the user clicks the "Clear" button, to remove the JPanel.

I've used the .remove() and it removes it, but the problem I am having now is when the user clicks the calculate button a second time, both the first JPanel and the second Jpanel are shown.

I would like to completely delete the JPanel when the user clicks the "Clear" button so if the user clicks the "calculate" button a second time, only 1 JPanel(with Jtable and scrollPane) are visible.

oc084a at 2007-7-12 1:44:59 > top of Java-index,Java Essentials,Java Programming...
# 5
In the future, Swing related questions should be posted in the Swing forum.After you add or remove a component from a visible GUI you need to use revalidate() on the panel you added or removed the component from.
camickra at 2007-7-12 1:44:59 > top of Java-index,Java Essentials,Java Programming...