Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7778113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:18:57+00:00 2026-06-01T18:18:57+00:00

I have a Gui which allows the user to click a button and view

  • 0

I have a Gui which allows the user to click a button and view the contents of a text file. The issue is that the file can be rather large (100,000+ rows of data) and can take upwards of 15 seconds to read and display in a table.

An example of the format of the text file:

*/
    Account ID     : 8 digit number
    Money Charged  : Integer < $10
    Values separated by \t 

/*


Account Id    Money Charged
----------    --------------
731298        3
359412        5
624937        1

So when the button is clicked, it reads each line and puts each id into a map and increases the charges of the accounts.

Once it is finished it will place a JTable inside a JDialog with the information. However, as soon as the button is clicked, the user could be confused as to what the program is doing as I’ve experienced upwards of 10-15 seconds of delay before the JDialog & JTable appears.

So is there a way to make the JDialog appear with a string letting the user know that it is creating the table? (I thought it would be done using one of the JDialog methods such as repaint() or validate but those didn’t seem to do the trick.

Here is the order I’m thinking it should be done:

//Psuedo-code
actionPerformed {
    create frame
    display label that lets user know its creating table
    read text file
    create map and place values
    remove label
    update dialog with table // unsure what to do to update it properly
}

So my overall question is simple:
Is it possible to inform the user that it is currently calculating the data (via JLabel in the JDialog) and once the data is read, display the JTable (by updating the JDialog)?

If needed, I can provide source. Not sure it’s really needed though

Edit

public void actionPerformed(ActionEvent event) {
    JFrame frame = new JFrame();
    JDialog dialog = new JDialog(frame, "Account Charges", true);
    JLabel label = new JLabel("Currently calculating the charges")

    dialog.getContentPane().add(label);       //add waiting label
    dialog.setVisible(true);              
    readData(myFile);                         //read file and create table
    dialog.getContentPane().remove(label);    //waiting label no longer needed
    dialog.getContentPane().add(myJtable);    //update dialog with the table
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T18:18:58+00:00Added an answer on June 1, 2026 at 6:18 pm

    1) I have a Gui which allows the user to click a button and view the contents of a text file.

    • use CardLayout, I’d to suggest to create another Container if you really needed to block or provide input mask for input / amend / delete of value that is already displayed or exist

    2) The issue is that the file can be rather large (100,000+ rows of data) and can take upwards of 15 seconds to read and display in a table.

    • I don’t know any man except the internal revision, that could be want to check or working with 100k rows, use SwingWorker fills FileIO to the TableModel, and create paginations for JTable

    3) //Psuedo-code

    actionPerformed {

    create frame – not JFrame re_use existing JDialog, sure better could be CardLayout

    display label that lets user know its creating table – no idea let it be

    read text file – use SwingWorker with JProgressBar, to transform data and put that to the TableModel, use batch for update of TableModel f.e. every 50rows, look for paginations for JTable, then you’ll display only required numbers of rows, not 100k, this could be crazy 🙂

    create map and place values – could be useless because you are storing all required informations in the TableModel

    remove label – no idea let it be

    update dialog with table – Jtable could be updated immediatelly from SwinWorker, Swing GUI could be accesible for all Mouse or KeyBoards inputs, never waiting, nor delay at 10-15sec

    }

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a GUI which allows the user to select a report to view/edit.
I have a GUI which has a couple of checkboxes that control special modes
I have designed a GUI which has an uitable and a push button which,
I have a Flex GUI which is using AMF Streaming to BlazeDS on WebLogic
I have a GUI application which works with point cloud data and a quadtree
I have 2 projects. One project is a core and contains the GUI which
I have a GUI app written in C++/CLI which has a load of configurable
I have designed this gui in netBeans which has a canvas , a couple
I have a win32 GUI (MFC) application which I need to port to a
i have this GUI screen shots from the design team which i needs to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.