Results 1 to 3 of 3
  1. #1
    ravidasineni is offline Member
    Join Date
    Nov 2009
    Posts
    4
    Rep Power
    0

    Default problem on progress bar

    Dear,

    I am doing the swing application in netbeansIDE.In that i select javadesktop application.In my project i take progressbar to show the progress of my application.when the application is start running i start the progresbar as

    progressBar pb;

    hear the progress bar is starting with max value 0

    pb.setStringPainted(true);
    pb.setValue(0);

    and i run some methods like

    obj.setDatastore();
    obj.Annot();
    obj.medication();

    when executing the methods the progress bar is not incremented.according to running my application i want to increase my progress bar.But not manually incremented.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,421
    Rep Power
    20

    Default

    Read the API for JProgressBar and follow the link to the tutorial on "How to Monitor Pregress" where you will find working examples. If you still have a problem, post a SSCCE* and ask a specific question.

    * SSCCE : Java Glossary

    db

  3. #3
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    I can't say that progress won't show if the progress bar is updated by a process running on the EDT, but progress bars were made to be updated by a process running in another thread. Note that the progress updates have to be made using EventQueue.InvokeLater() so they happen on the EDT, but doing so gives the EDT time to redraw the screen. Possibly, you are updating the progress bar, but the fact that the main process is blocking the EDT is preventing the updates from appearing. Also, max value = 0 doesn't sound like a good idea...

Similar Threads

  1. progress bar problem
    By LeonLanford in forum New To Java
    Replies: 2
    Last Post: 10-21-2009, 05:14 PM
  2. trying to use progress bar for the first time.
    By IYIaster in forum New To Java
    Replies: 19
    Last Post: 07-26-2009, 04:59 AM
  3. How to use Progress bar
    By LankanSniper in forum AWT / Swing
    Replies: 3
    Last Post: 03-25-2009, 11:44 AM
  4. how to implement progress bar .....
    By roshithmca in forum AWT / Swing
    Replies: 1
    Last Post: 03-06-2008, 05:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •