Two JTables are showing in a JFrame after two file selections.  I only want one shoiwing.

Posted on 2009-12-30
Last Modified: 2013-11-23
I have a small file chooser which is really a JFrame.  I select one file to tabulate and show in my application.  The first time the tabular data shows fine in the JTable however the second time I select the file another JTable with the tabular data shows in the parent JFrame also.  I want to "erase" or clear out the first iterations data JTable and I want to only show the second.  How would I do this?
Question by:jwright9
    LVL 86

    Expert Comment

    You need to post your code
    LVL 92

    Accepted Solution

    create a new (table) model each time instead of adding the data to the table
    alternatively clear the table each time before you load the data

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
    Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    This video teaches viewers about errors in exception handling.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now