JProgressBar is not updating even in new Thread !

Hello every buddy....
I'm new to SDN and I hope I'll enjoy being an active member.
I've a problem with updating JProgressBar in actionPerformed method. I know that GUI can not be updating in the event dispatching thread, so, I created a new class to show the JProgress bar in a separate thread as follows:
{color:#333399}import javax.swing.JProgressBar;
import javax.swing.Frame;
public class ProgressBar
public ProgressBar()
new Thread(new Runnable()
public void run()
showProgressBar();
}).start();
}// End of constructor
private void showProgressBar()
JProgressBar pb = new JProgressBar(0, 100);
pb.setPainted(true);
JFrame f = new Frame();
f.setSize(250, 100);
f.getContentPane().add(pb);
f.setVisible(true);
while( Crypt.done == false)
pb.setValue( Crypt.percentageCompleted );
f.dispose();
f = null;
}// End of showProgressBar method
} // End of ProgressBar class
{color}{color:#000000}I create an objmect of the above class inside another class called Crypt. when a button is clicked actionPerformed is invoked I do:
ProgressBar progress = new ProgressBar();
the frame f shows, but the JProgressBar never shows!
Can anyone help me?
with best wishes{color}

scphan wrote:
your declaration worked when i plugged it in into my program
but the way you've programmed the JProgressBar to update is very inefficient, you should just get a ref to your JProgressBar and call setValue() from inside the loop of whatever you're doing
Edited by: scphan on Mar 24, 2009 10:04 AMThat's bad advice. The setValue method must be invoked on the EDT. I suggest using a SwingWorker and its progress bound property:
[http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html]

Similar Messages

  • Lightroom 5.7 will not update even through I pay the $9.99 per month for Photoshoto CC and lightroom ?

    Lightroom 5.7 will not update even through I pay thr $9.99 per month for Photoshop CC and Lightroom ?

    Hi Glenys,
    Here's another forum thread that may help (related discussion), if you can't find the new version:
    I have Creative Cloud for Photographers. How do I get Lightroom CC?

  • HT5460 I can  not update to the new OS X Mountain Lion. Whenever I do I get a message an error has occurred, timed out 102.W

    I can not update to the new OS x Mountain Lion.  I get an error that  says it has timed out then "102".   WHy can't I get it update??
    Thanks for your help.

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, or by corruption of certain system caches. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled on some models, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output and  Wi-Fi on certain models. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Folder Redirection did not update to the new server

    hello  guys, I had migrated quite some time ago to a new server.
    I thought everything works fine, basically the server functionality DNS, Replication and other stuff works fine.
    But I notice that some of the workstation did not actually update its folder redirection to the new server.
    Their desktop and my documents still points to the old server.
    So their offline files, is becoming larger and larger.
    I have some workaround but it's a lot of work. Question is, why those Win 7 workstation folder redirection did not update to the new server.
    What should be the best practice? During the migration process from the old server to the new server, all workstation should be turned on? 
    Or any tools to update  those workstation to the new server without losing their files?
    Basically, just editing the registry to point to the new server will help. But it means losing their current files and whatever old stuff that is on the server will be the one that will be shown on their desktop and documents.
    any inputs is greatly appreciated.
    Every second counts..make use of it. Disclaimer: This posting is provided AS IS with no warranties or guarantees and confers no rights.
    IT Stuff Quick Bytes

    Hi biswajeetpattnaik, before migration it was Windows 2003.
    Then I introduce Windows 2008.
    Then I introduce a new Windows 2012.
    Now Windows 2012 is the main DC.
    Actually, everything is under control right now.  As what I said on my first post, I manage to do some work around.
    The only question I have on mind, is how on earth this thing happen.
    I was assuming, that the workstation will be able to point to the new server, without any glitch since everything is working fine.
    And the GPO was applying on the workstation. If I type gpresult /v on the workstation is it being applied. Even if I run GP Modelling it is also shows on the result that the folder redirection is being applied.
    But to my surprise the folder redirection still points to old server, if I have not discovered it then it would be difficult if some files will get lost.
    Thanks for your reply.
    Every second counts..make use of it. Disclaimer: This posting is provided AS IS with no warranties or guarantees and confers no rights.
    IT Stuff Quick Bytes

  • I have the iPhone 5s. I synced it with my Mac and got all the old apps from my old phone. I was not able to update any of the apps on the old phone and they will not update on the new iPhone 5s either! What can I do?

    I have the iPhone 5s. I synced it with my Mac and got all the old apps from my old phone. I was not able to update any of the apps on the old phone and they will not update on the new iPhone 5s either! What can I do?

    Hey there rmflint,
    It sounds like you are wanting to update the Apps that were synced over from your computer to your new iPhone 5s. If you are clicking Updates in the App Store in the bottom right corner, would you mind clarifying what happens when you are trying to update them? 
    App Store at a glance
    http://help.apple.com/iphone/7/#/iph3dfd8c19
    Thank you for using Apple Support Communities.
    Take care,
    Sterling

  • Itunes will not update to a newer version.

    Itunes will not update to a newer version. The error received sates an older version could not be removed.

    The error is specifically an older version of Itunes could not be removed.
    Many thanks, alex. We'll first try the iTunes variation of my standard instructions, then.
    Unfortunately, this sort of trouble has gotten more complicated to deal with ever since Microsoft pulled the Windows Installer CleanUp utility from their Download Center on June 25. First we have to find a copy of the utility.
    Let's try Googling. (Best not to use Bing, I think.) Look for a working download site for at least version 3.0 of the Windows Installer CleanUp utility. After downloading the utility installer file (msicuu2.exe), scan the file for malware, just in case. (I use the free version of Malwarebytes AntiMalware to do single-file scans for that.)
    If the file is clean, to install the utility, doubleclick the msicuu2.exe file you've downloaded.
    Now run the utility ("Start > All Programs > Windows Install Clean Up"). In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove".
    Quit out of CleanUp, restart the PC and try installing iTunes again. Does the install go through properly now?
    (If you do find a clean download site for the correct version of CleanUp, please don't tell me where it is. Without wishing to sound paranoid (although I grant it does sound paranoid), there is a non-zero chance that posting links to download locations for the utility here at Discussions leads to that download location being shut down.)

  • Ancient Aliens is not updating.  The new shows in season 6 are not showing up.  Please advise

    Ancient Aliens is not updating.  The new shows in season 6 are not showing up.  Please advise

    Sorry about that... Thanks in advance for your help
    Actually Itunes has now started picking up all the shows again. But I would still like to know why we had the issue. Any ideas? Thanks
    In itunes http://itunes.apple.com/us/podcast/cycling-360-media/id431852609
    Feedburner feed pointing to itunes http://feeds.feedburner.com/Cycling360
    Feed pointing to feedburner http://www.cycling360media.com/?feed=rss2

  • Will not update even though i tapped update all

    My ipad will not update even though I tapped update all. any suggestions, thanks

    Is your payment information current for your Apple ID?  Even though updates are free, your account may not allow updates if it has an issue like an expired credit card, or an updated password that you have not yet entered into the device's iTunes Store account settings.

  • HT5569 My computer is not updating to the new itunes 11.1. Is there a link that you can give me to update it specifically? Because my ipod won't work on my laptop unless itunes is updated.

    My computer is not updating to the new itunes 11.1. Is there a link that you can give me to update it specifically? Because my ipod won't work on my laptop unless itunes is updated. I unistalled the 11.0 version because when I tried to update it through itunes it wasn't working. HELPPPPPPPP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Try:
    http://www.apple.com/itunes/download/
    ALso maybe:
    Trouble installing iTunes or QuickTime for Windows

  • Lync photo not updated even AD Profile is already updated

    Hi Gurus,
    I have similar issues with others in the forum which photo in lync client is not updated even though the its already changed in Active Directory. The others said we have to do this step :
    1. Run Update-csaddressbook
    2. Delete cache files ( ex : [email protected] )
    I did those steps but still have no luck on the issues. Is there anyone have this experience or have any solutions for this issues. Thank you very much.
    Regards,
    Maliq

    I agree with Johan...
    What Exchange server are you on?
    First run Update-CsUserDatabase - this sync FE database with AD info
    Running with -verbose will post that replication will take place in 5 minutes..
    Then run Update-CSAddressbook - This update the FE address book with the Info from its own Database
    Once again this will tell you it will begin replicating in 5 minutes...
    After 10 minutes you should be able to clear the cached files from the client and restart lync ...
    Here's a script a created to clear teh cached files on a client system, this should be run as teh standard user, as it grabs teh logge don users creds and clears the directory according to the logged on user..
    Save as a batch, on a network share accessible by everyone and run away safe time!
    @echo off
    :Start
    echo.
    rem ###### Check if Lync is running, exit if it is... #####
    tasklist /fi "IMAGENAME eq lync.exe" | find "lync.exe" >nul
    If %errorlevel%==0 goto LyncIsRunningError
    rem ###### Grab logged on user info, and remove Lync cache files, All of them! ######
    for /f "tokens=2 delims=\" %%a in ('wmic computersystem get username ^| findstr /v "UserName"') do @set username=%%a
    set uname=%username: =%
    If Exist "C:\Users\%uname%\appdata\local\Microsoft\Office\15.0\Lync\" rmdir "C:\Users\%uname%\appdata\local\Microsoft\Office\15.0\Lync\" /S /Q
    echo Clearing Lync 2013 Address Books... Done!
    echo.
    echo Sign back into Lync 2013 to download the current address book.
    goto End
    :LyncIsRunningError
    echo ERROR: Lync found to be running, closing all instances!
    taskkill /f /im lync.exe
    taskkill /f /im UCMapi.exe
    echo Done, waiting 5 seconds and trying again.
    timeout 5
    echo.
    goto Start
    :End
    And do you have any idea of difficult it is to place a cmd output into a variable in BATCH scripting?! redic!
    No it will say it can't remove a certain folder in the cached location if the user has outlook running... i didn't no script to close outlook for it doesn't get effect, or it still works either way..
    I'm also going to add that you go onto the FE server and check the attribute on user contactcard to ensure that the DisplayADPhoto attribute is set to True..
    Logon onto FE server - open powershell - and user the export-csuserdata command with the -legacy option to export as an xml file and then open the xml in IE and search for that attribute...

  • Documents that are park in FBV0 do not update with the new user name when

    Hi,
         I need to find out why documents that are park in FBV0 do not update with the new user name when any changes are made.  Also when we park using MIR7 and make changes to the documents at a later time the document updates with the new users name.
    Requesting you to please suggest what could be the reason.
    Earliest reply will be highly appreciated,
    With regards,
    Rj

    Hi,
        I have checked this in system. I posted one Parked invoice using T.code FV60 and there i appeared my name because i created. But after some time one of my collegue changed the reference and text field with his login i.d. But still in the invoice it is showing as my name whereas if we go to the environmnet, there in the changes we can see what are the changes done and it is appearing my collegues user i.d. But in the main invoice it is still appearing my name.
    Regards,
    Rj.

  • AME will not update to the new release

    AME will not update to the new release.  Tried from the help menu in both AME and Premiere.  It Fails each time I try.  Is this a known issue.  I was not able to update AE or Premiere from the CC app manager.  I had to update those both from the update item in the help menus of each program.  What is going on?

    There are two steps in patching via creative cloud or from within the application.
    1. download the patch
    2 apply the patch
    Which stage failed for you? 
    I did run into download issue yesterday where CC tried to download patches for a few apps at the same time and it failed to download.  I suspect the servers that patches reside on were busy.  When I tried it a few hours later, it worked.
    You can download the manual patchers from these locations:
    http://www.adobe.com/support/downloads/product.jsp?product=160&platform=Macintosh
    http://www.adobe.com/support/downloads/product.jsp?product=160&platform=Windows

  • My phone blacked out, will not turn on, and i did not update to the new software! So what is my Apple iPhones5s problem?

    My iPhone blacked out, and will not turn on. I did not update to the new software! So what is my Apple iPhone 5s problem?
    A lot of issues with iPhones lately, maybe apple has an issue developing and implementing their inovations.

    Hi InUtero, 
    Welcome to the Apple Support Communities!
    I can understand your frustration if your iPhone is not turning on as expected. The first thing I would suggest in this situation is a reset. Please use the following article for instructions on how to reset your iPhone. Please be sure to let me know if you need further assistance. 
    Turn your iOS device off and on (restart) and reset
    Have a great day, 
    Joe

  • TS3988 my iphone will not update to the new email and password

    my iphone will not update with the new email and password

    Is your phone signed into an old iCloud ID of yours in Settings>iCloud?

  • When I try to edit my payment method it keeps saving the old card and not updating to the new one?

    When I try to edit my payment method it keeps saving the old card and not updating to the new one?

    You likely need to change the default application(s) assigned for opening files to point to the new ones.  HOw you do that depends on which operating system you have. If you search Google you should be able to find out how to change the default programs for different files.

Maybe you are looking for

  • How can i open the archived pst file in my Mac Air

    How can i open the Archived outlook pst file in my Mac air, i want to access my old outlook mails.

  • Ovi maps

    It seriously gives terrible directions.  It always tells me to take a route that takes way longer than it needs to be!  I tested it out with routes I knew-- and twice, it gave me routes that would take up to 30 minutes more of driving.  And if I sele

  • Single Edition Licence with CC

    I plan to subscribe to a single app licence for Creative Cloud (for InDesign CS6). Will I still be able to publish single edition apps through DPS with this Creative Cloud model, or do I have to have the full membership (all apps)? Thanks

  • Accidentally removed a purchased app from the list

    Accidently removed an app from the purchased list. How do I get it back on the list. Alos is there a way to get App Store from continually saying that this app needs to be updated when in fact it is? Allan

  • Canon HV20 with 24p

    I have FCP ver 5.0.4, and am trying to edit a 24p sequence shot with a Canon HV20. I have gone through and done the reverse telecine with my clip, and successfully gotten my 1080i60 clip off the tape and it's now 1080-24p. In my sequence settings I c