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

  • SEARCH
  • Home
  • 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 918853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:26:41+00:00 2026-05-15T18:26:41+00:00

I was adding a loading bar feature to my program in Java and I

  • 0

I was adding a loading bar feature to my program in Java and I was wondering if I could set a list of processes that need to be done, so that it knows how many processes it needs to complete.

For example, saving them as strings?

ArrayList<String> processes = new ArrayList<String>();
processes.add("CSVWriter.createFileOfCompany(\"Random Company\");");
processes.add("FileConverter.convertCSVToXLS(classPath + 
    \"/Output/Random_Company.csv\");");

for (int i = 0; i < processes.size(); i++) {
    // run process
    // update loading bar
}

These aren’t real methods to my program, but they are pretty similar to what I want to accomplish.

I’m sure this isn’t the best way, but I want to have some way to create a list like this so I know how many processes there are before I run them. I have a system set up to break down these processes even further and show their progress, so this bar is pretty precise at the moment, but I have to number each of the processes =/.

Maybe I’m just missing the point. Creating progress bars is totally new to me.

If there are any good articles on progress bar creation, feel free to send them my way as well. Keep in mind that I’m not using an actual swing-based GUI. This bar is all S.O.P text.

Many thanks,

Justian Meyer

  • 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-05-15T18:26:42+00:00Added an answer on May 15, 2026 at 6:26 pm

    Closures will hopefully be coming soon in the next version of Java, but until then you can use anonymous classes implementing a known interface:

    List<Runnable> jobs = new ArrayList<Runnable>();
    
    jobs.add(new Runnable() {
        public void run() {
            CSVWriter.createFileOfCompany("Random Company");
        }
    });
    
    jobs.add(new Runnable() {
        public void run() {
            FileConverter.convertCSVToXLS(classPath + "/Output/Random_Company.csv");
        }
    });
    
    for (Runnable job : jobs) {
        job.run();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am loading json into a list of objects I am adding to a
I have the following function that updates the UpdatePanel content by adding/loading an ascx
Please i need some help in adding items to a JComboBox in Java from
In our Java Swing application, we're loading a custom font and adding it to
I am loading an external SWF using the Loader class, and adding it to
Adding functionality to a class can be done by adding a method or by
I want to create loading progress bar when my activity is starting. I have
I'm trying to make a loading overlay thing. Currently, I have some javascript adding
I am adding a UILabel to a view meant for loading purposes. However, it
I am loading a bunch of data and adding it to a div. However,

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.