2 Replies Latest reply on Feb 25, 2013 3:42 PM by 914035

    Progress bar help...

      I have a swing desktop application that uses a servlet that connects to an app server. An action is performed from a button which calls the servlet and does some processing and database calls. I want to have a progress bar or spinning wheel while these actions are being performed to know that processing is actually occurring. I'm just not sure how to have the progress bar progress while another action is being performed. Also, I would want to have the progress bar in the indeterminate mode because I just want the user to know that calculations are being performed and that the application is not locked up or not doing anything. Any help would be great and thanks in advance.
        • 1. Re: Progress bar help...
          did you have a look at this tutorial?
          • 2. Re: Progress bar help...
            I did look at the tutorial, the problem I am encountering is that the progress bar won't run while the servlet is called, it only runs when it returns. I am using the following code:

            public static class thread1 implements Runnable {

            public void run(){
            while (true){ //Progressively increment variable i

            try{Thread.sleep(50);} //Sleep 50 milliseconds

            catch (InterruptedException err){}



            Then I call the thread using the following when a button is pressed:

            buttonAction() {

            new Thread(new thread1()).start();

            // call to servlet

            // stop thread