JProgress Bar but No Progress in NetBeans5.0

i have the following code in NetBeans5.0 it not working. why is it so
please any one can help me about this
i have a function called update
public void updateBar(int newValue) {
    jProgressBar1.setValue(newValue);
    System.out.println("reached here in updatebar"+ newValue);
  }above one is invoked by this method
public void display()
      final Template it = new Template();
       for (int i =0; i <= 100; i++) {
      try {
          final int percent = i;
        SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            it.updateBar(percent);
        java.lang.Thread.sleep(100);
      } catch (InterruptedException e) {
  }this is main method through which i am invoking it
i just called the above function in a button click
public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Template().setVisible(true);
        });

http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html

Similar Messages

  • Using JProgress bar

    Dear all
    I am trying to you jprogress bar because on the program I am doing at the moment there are a lot of functions that take time to execute and so I thought that it would be good to use jprogress bar but I am not sure how to use it.
    I looked at the progress bar demo in the java tutorial but It didn't tell me how to connect the progress bar with my program.
    For an instance in my program there is an image and when you click on the "Detect Corners" button all the corners in the image are loaded in the shape of a triangle around the corner but this process takes time and I would like to add progress to show the progress but I am not sure how to do that.
    Cheers

    i use a quick-loading picture of lindsay lohan to distract the user while the time-intensive stuff goes on in the background.

  • HT1339 My iPod classic shows that memory full in "other" category however there is nothing on it. I have left it connected all day and over night trying to restore it but the progress bar  never goes away.

    My iPod classic shows that memory full in other category however there is nothing on it. I have left it connected all day and over night trying to restore it but the progress bar  never goes away. Is it shot or are there other options to restore to factory settings?

    Hi pbworth,
    When troubleshooting issues with iPod classic, it may be helpful to place the iPod into Disk Mode. For information on how to do so:
    Putting iPod into Disk Mode
    http://support.apple.com/kb/HT1363
    Thanks,
    Matt M.

  • I am running OS X 10.7.5 on my MacBook Air, but I cannot download Mavericks. I tried downloading after a safe boot, but the progress bar hung up. Any other ideas?

    I'm running OS X 10.7.5 on my MacBook Air, but I cannot download Mavericks. I've tried downloading after a safe boot, but the progress bar and the download hung up. Any ideas?

    It can be a long download, so keep trying. My first download was at 3 am Cupertino time and took less than an hour. The second took close to three hours one evening.
    Phil

  • HT201269 my 5s broke so i got a new one and the info isnt transfering the phone just shows the apple and a progress bar but the bar isnt moving what so ever

    phone wont progress from icloud transfer

    Hey there ddjild,
    It sounds like you are restoring your previous phones backup to your new one, but the progress bar appears to be stuck. According to this article:
    iOS: Apple logo with progress bar after updating or restoring from backup
    http://support.apple.com/kb/TS3681
    the process can take from several minutes to an hour to complete. The amount of time depends on the number of files on the device and whether you're erasing, updating, or upgrading your iOS.
    If the device has stil not finished the process, I would recommend resetting the device with the following article:
    Turn your iOS device off and on (restart) and reset
    http://support.apple.com/kb/ht1430
    To reset, press and hold both the Sleep/Wake and Home buttons for at least 10 seconds, until you see the Apple logo.
    If that does not get the phone booted back to the Lock Screen so you can get to your Home Screen, I would next try putting the device into recovery mode and attempting another restore from that backup:
    If you can't update or restore your iOS device
    http://support.apple.com/kb/ht1808
    Thank you for using Apple Support Communities.
    Cheers,
    Sterling

  • HT4623 I am upgrading my iPad to iOS 7 but the progress bar is at 1/4 position for two hours and not moving forward. Is there any problem with it? What should I do? Thanks.

    I am upgrading my iPad to iOS 7 but the progress bar is at 1/4 position for two hours and not moving forward. Is there any problem with it? What should I do? Thanks.

    This is a concern amoung many corporate users.  It's going to take somekind of policy change with apple.
    Enterprise support:
    Call enterprise support  (866) 752-7753  to create  a case ID number

  • Compressor is not working. When I export to compressor from FCP to encode DVD, FCP freezes and Compressor appears to be working but the progress bar never fills no files are created. I'm using a MacBook Pro 10.6.7 version 2.66 GHz core 2 Duo 4GB 1067 MH

    Compressor is not working. When I export to compressor from FCP to encode DVD, FCP freezes and Compressor appears to be working but the progress bar never fills no files are created. I'm using a MacBook Pro 10.6.7 version 2.66 GHz core 2 Duo 4GB 1067 MH. I'm not new at this. I re-installed FCP successfully. I trashed the preferences. Please help.

    Do you have any filters applied to your clips?
    This happened to me before, I accidently had applied a broadcast safe filter to a color matte that was black....
    I figured it out by duplicating my sequence and deleting items from my timeline 1 by 1 until I was able to export a reference movie.
    Anywho, export again, this time with "self contained" movie selected.
    Then try to import to Compressor.

  • My ipad is in recovery mode that failed,it shows the progress bar but is frozen. Itunes shows the wrong name for the Ipad but the correct account.

    my ipad is in recovery mode that failed,it shows the progress bar but is frozen. Itunes shows the wrong name for the Ipad but the correct account.

    You're gonna have to restore the iPhone from your last backup with iTunes. You did do a backup before you attempted to update the software didn't you?

  • JProgress bar automatic updation as web page uploads

    hi,
    I am new java programmer. I am supposed to make a Java browser with some functions similar to Internet Explorer.
    As I started Swing just a week back, I am really bad at it. Though i finished all the other parts, just one thing to add a final touch i need is to create a Jprogress bar which gets updated automatically as page is uploaded. Can anyone help me about that? I have studied the tutorials on JProgressBar and was able to create a timer based bar but not a bar that woks as a status bar i.e. as the page is uploaded.
    I would be very very grateful if anyone could guide me.
    Thanking You in advance.
    Manish Kumar

    You could use a 'fake' progress bar (that moves independently). That's what even Internet Explorer does. You cannot know anyways if or when a page will be loaded. Just let something move to let the user know that something is still going on. Do you know what I mean? Even an animated GIF could do the job.
    A smarter way would be to let the progress bar show different constant values depending on what is happening: 10% when the request was sent, 20% when the server is contacted, 30% when the server responds and so on.

  • Apple logo and a bar with no progress after iOS 5 update D:

    After updating to iOS 5, strange things are happening now on my 32GB iPod touch 4th Gen..... It gest stuckwith a black background, a the apple logo, and a white progress bar with no progress at all.... it's been like that for hours now.... i can't close it even if i hold the power button for minutes so i let the battery die over night..... the same thing happened this morning.... and it became slightly hotter now....
    iTunes seems to act stranger... at the capacity bar below where it shows how much space is available on my ipod touch, the OTHERS is just a few back then, it is now the majority of it leaving only 14.9 GB free of storage( where it is 25 before). And when I accidentally pressed sync, it suddenly freezes. I got tired. And I discontinued.
    To summarize:
    I updated my ipod touch to iOS 5
    Now, I can't use it anymore
    the iPod heats up when charged
    iTunes provide no help at all
    iPod touch's screen freezes to the apple logo and a progress bar with no progress after it is charged
    What should I do now?
    =============================================================
    One more thing, before any of these happened, i think i forgot to turn on Wi-Fi before the update. Can this be another factor the problem?

    Something similar happened when I upgraded my 4th gen 8 gig iPod touch. It turns on and operates fine but I had the same space issue. The others category  takes up 2.3 gb of space and the empty space is 1.8 instead of the 3.9 I had before. Also, at least half of my songs won't even play. Apple needs to help us out here.

  • Compressor gets stuck and task bar doesn't progress at all

    I have set the settings I want compressor to do but, it gets stuck from after I press submit. Task bar doesn't "progress" and, all the jobs are in "waiting"
    Any ideas Anyone ?

    I had a similar problem and Digital Rebellion's Compressor repair did not help but their FCS uninstaller did.
    You will need all of your FCS discs because there are many shared elements related to Compressor and Q Master. It took a few hours but after I did this Compressor was back to normal.

  • Jprogress bar from multiple threads?

    Hello,
    I have three background tasks running in separate threads. In those tasks, I've written methods for setting the progress. I haven't worked with progress bars very much but I know how to get one to display and update for one task. My question is, how do I create one progress bar, that would update with the total progress of the three combined tasks?
    Edited by: Sch104 on Jun 16, 2008 1:59 PM

    Hmm ok well so far, here is what happens,
    I click Run(a menu option)
    the progress bar pops up in its own window as intended.
    progress bar doesn't display anything but calculations are still running in the background on the three worker threads.
    My class WorkerThread extends Thread. Inside run() it calls the method to calculate the data. In the calculate() method, I use SwingUtilities.invokeLater() to calcProgress() and then set my progress bar's value to that new value.
    Here is the relevant code:
    InvokeLater() inside of calcSoilMoistureTemp():
    SwingUtilities.invokeLater(new Runnable()
                             public void run()
                                  if (soilModel.fluxGraph){
                                       soilModel._livePanel.addPoints(soilModel.time,
                                                 soilModel._weather.surfacetemp[soilModel.day][soilModel.minutes],
                                                 soilModel.soilNodes.get(soilModel.m).getOldWaterContent(),
                                                 soilModel.soilNodes.get(soilModel.m/2).getOldWaterContent(),
                                                 soilModel.soilNodes.get(soilModel.m-2).getOldWaterContent(),
                                                 soilModel.soilNodes.get(soilModel.m).getNewTemperature(),
                                                 soilModel.soilNodes.get(soilModel.m/2).getNewTemperature(),
                                                 soilModel.soilNodes.get(soilModel.m-2).getNewTemperature(),
                                                 soilModel.soilNodes.get(1).getFlux());
                                  else{
                                       soilModel._livePanel.addPoints(soilModel.time,
                                                 soilModel._weather.surfacetemp[soilModel.day][soilModel.minutes],
                                                 soilModel.soilNodes.get(soilModel.m).getOldWaterContent(),
                                                 soilModel.soilNodes.get(soilModel.m/2).getOldWaterContent(),
                                                 soilModel.soilNodes.get(soilModel.m-2).getOldWaterContent(),
                                                 soilModel.soilNodes.get(soilModel.m).getNewTemperature(),
                                                 soilModel.soilNodes.get(soilModel.m/2).getNewTemperature(),
                                                 soilModel.soilNodes.get(soilModel.m-2).getNewTemperature(),
                                                 soilModel.hf);
                                  calcProgress();
                                  _parent.modelProgress.setValue(_parent.modelProgress.getValue()+ (percentcomplete/_parent.getModelRuns()));
                        });Here is my WorkerThread:
    import java.io.IOException;
    import backend.SoilCalc;
    import backend.SoilModel;
    public class WorkerThread extends Thread{
         SoilModel model;
         public WorkerThread(SoilModel model) {
              this.model = model;
         @Override
         public void run() {
              try {
                   SoilCalc calc = new SoilCalc(model);
                   calc.calcSoilMoistureTemp();
              } catch (NumberFormatException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    }and Where I call my threads:
                             // Set the number of threads to be created
                             int numThread = 0;
                             numThread = soilQueue.length;
                             // Create the threads and make each one start.
                             Thread[] threads = new Thread[numThread];
                             for (int i=0; i < numThread; i++) {
                                  if (soilQueue[i] != null){
                                       threads[i] = new WorkerThread(soilQueue);
                                       threads[i].start();
                             //Wait for each thread to finish
                             try {
                                  for (int i=0; i < numThread; i++) {
                                       if (threads[i] != null){
                                            threads[i].join();
                             catch (InterruptedException e1) {
                                  // TODO Auto-generated catch block
                                  e1.printStackTrace();
                             }Why won't it update the progress bar? I'm doing the calculations in workerthreads so that should leave the EDT open to accept the progress bar update correct?
    Edited by: Sch104 on Jun 16, 2008 2:34 PM
    I tried creating the progress bar in a new thread as well. no luck. The window for it appears but the progress bar never updates. It shows whatever was in the window behind it.  Is the join() blocking?
    Edited by: Sch104 on Jun 16, 2008 3:44 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • The status bar is pushed up at about 3/4 of the screen, so I can view onlu firefox at about 1/4, good thing there is a scroll bar, but below the status bar is white display? can u please help me, I want to drag down the status bar so I can have a full vi

    The status bar is pushed up at about 3/4 of the screen, so I can view only Firefox at about 1/4, good thing there is a scroll bar, but below the status bar is white display? can u please help me, I want to drag down the status bar so I can have a full view
    == This happened ==
    Every time Firefox opened

    Your code is absolutely unreadable - even if someone was willing to
    help, it's simply impossible. I do give you a few tips, though: If you
    understand your code (i.e. if it really is YOUR code), you should be
    able to realize that your minimum and maximum never get set (thus they
    are both 0) and your exam 3 is set with the wrong value. SEE where
    those should get set and figure out why they're not. Chances are you
    are doing something to them that makes one 'if' fail or you just
    erroneously assign a wrong variable!

  • Firefox 3.6 on Mac - stopped retrieving pages - just says "done" in message bar but no page.

    Now Fixed Thanks.
    Firefox 3.6 on Mac - I update as available and last version installed about November. Week before Xmas it just stopped retrieving pages - just says "done" in the message bar but no page. I downloaded latest version to reinstall but it refused to install over the old copy: message said "item XUL in use". I trashed the app file and reinstalled from the new installer, same problem. Trashed the prefs file - now when I try to open firefox the message says "a copy of firefox already open". Have rebooted and tried again but same message. Safari isn't that bad but I like firefox. Help!

    yes - I have the same issue on four different people's new MacBook Pro's on 10.6.4. I have deleted the Profiles numerous times, but the issue still occurs at least once every two weeks.

  • Getting bars but no internet with new airport extreme

    HI,
    I purchased a new AEBS for my restaurant. I set it up and it worked great. My Powerbook g4 was connecting and I was getting internet fine. The next time I went to the restaurant and opened my Powerbook I was getting airport bars but was unable to connect. My son has a Powerbook as well and he is connecting just fine. Several customers came in with Macs and they were also unable to connect. I know I'm getting internet from the modem. I've tried unplugging both the modem and AEBS and then reconnecting with no resolution. I've tried to re-set up the AEBS but it says it is not getting the IP address. I'm about to throw out the AEBS and go get a Linksys!
    I've read other posts of folks with this same problem and one of the solutions is to roll back to a previous firmware version. How is that done?
    Powerbook G4 aluminum, 1.25ghz
    Thanks for any help

    I have no problem gettiing the Macbook pro to set itself up on the Airport Network. I can NOT, though, access the internet. I even tried to type in the IP address for the DSL modem while connected to Airport base and can not connect to modem. Does anyone have any advice? Is there a bridging function in the Airport Base that has to be activated?
    Make sure you perform a complete power recycle when switching network components.
    Modem/Router Power ReCycling
    - Power-off the DSL modem & AEBS. (Wait at least 30 minutes. If possible, leave the modem off overnight.)
    - Power-on the DSL modem; Wait at least 30 minutes.
    - Power-on the AEBS; Wait at least 5 minutes.
    If that doesn't resolve the problem, and your DSL ISP requires PPPoE for connectivity, you will need to set that up on your AirPort Extreme Base Station (AEBS) as follows:
    Connect your computer directly (using an Ethernet cable) to the LAN port of the AEBS, and then, using the AirPort Admin Utility, check these settings:
    Internet tab
    - Connect Using: PPP over Ethernet (PPPoE)
    - Account Name: <ISP account name>
    - Change password: <ISP password>
    - Always stay connected (checked)
    - WAN Ethernet Port: Automatic
    Another question. If I replace my current DSL Router with a wireless router, do I even need the airport base if all I want to do it connect to the internet with the laptop?
    No, the AEBS will no longer be required.

Maybe you are looking for