Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

removing JTable

843805Apr 24 2007 — edited Apr 24 2007
I posted this problem earlier but didn't get a solution that worked. Also I was told to post this in the swing forum so here is my problem.

I have a mortgage caculator that calculates a monthly mortgage payment and displays the mortgage's amortization table(when/if the user presses the table button). I also have a clear button that clears all the fields and removes the JPanel that my JTable is on.

My problem is this. When I click the Clear button, The JPanel is removed with the following code(it does what i want it to do):
getContentPane().remove(amortTablePanel);
getContentPane().repaint();
My problem is that when i calculate another mortgage and click the Amortization Table button, both the first and the second tables show up.

How can I completely remove the table when i click the Clear button?

Thanks in advance.

Message was edited by:
oc084
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 22 2007
Added on Apr 24 2007
7 comments
71 views