Problem with the progress bar in swings

Hi all,
I need to show a progress bar till another window opens up in swings.Below is the code i used to show the progress bar.My problem is i am able to get the dialog box where i have set the progress bar but i cldnt get the progress bar.But after the specified delay,another window gets loaded.
Plz tell me how to show a progress bar till another window loads.Any help is greatly appreciated :-)
                //Show the progress bar till the AJScreens loads.
                // Create a dialog that will display the progress.
                final JDialog dlg = new JDialog(this, "Progress Dialog", true);
                JProgressBar dpb = new JProgressBar();
                dpb.setVisible(true);
                dpb.setStringPainted(true);
                dpb.setBounds(70,60,150,10);
                dlg.getContentPane().setLayout(new BorderLayout());
                dlg.getContentPane().add(BorderLayout.CENTER, dpb);
                dlg.getContentPane().add(BorderLayout.NORTH, new JLabel("Progress..."));
                dlg.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
                dlg.setSize(300, 75);
                dlg.setLocationRelativeTo(this);
                // Create a new thread and call show within the thread.
                Thread t = new Thread(new Runnable(){
                    public void run() {
System.out.println("atleast comes here --->");
                        dlg.show();
                // Start the thread so that the dialog will show.
System.out.println("Gonna start the thread --> ");
                t.start();
System.out.println("Thread started --> ");
                // Perform computation. Since the modal dialogs show() was called in
                // a thread, the main thread is not blocked. We can continue with computation
                // in the main thread.
                for(int i =0; i<=100; i++) {
                    // Set the value that the dialog will display on the progressbar.
System.out.println("i ----------> "+i);
                    dpb.setVisible(true);
                    dpb.setValue(i);
                    try {
                        Thread.sleep(25);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                // Finished computation. Now hide the dialog. This will also stop the
                // thread since the "run" method will return.
                dlg.hide();regards,
kani.

Yeah i have tried that also.But no hope.
My problem is am able to get the dialog box but not the progressbar,after the specified delay the dialog box goess off and the new window loads up.
the progress bar is not getting displayed..that is my problem..
can u plz help me out.

Similar Messages

  • Problem with the progress bar

    I've have a problem with the progress bar of my ipod. I bought a 5th generation ipod about 8-9 months ago. Now its progress bar stuck so it only shows the 5 dots. It doesn't show both scrubber bar and song time bar. When I press the center button, the 5 dots dissappear from the screen and then reappear but it doesn't show the other bars. Do you know what is the problem and How can I fixed it?

    have you tried resetting ipod, cause as far as i know, this is sometimes just a temporary glitch, mine does this.

  • HT1212 My ipad mini has been crashing a lot recently so I started a system reset. However, it's now stuck with the progress bar less than a quarter gone: this has been the case for several days now. I have tried resetting from itunes but it needs the pass

    Now it's stuck with the progress bar less than a quarter full. I have also tried resetting through itunes which works right up to the point where itunes states that it needs the passcode to be inputted into the ipad to connect to it. At which point it then sticks at the same progress bar point. HELP!! please, this ipad is really important to my work.

    Well the term "hotlined" I have never heard before. In any case many states (like NY) just passed regulatory powers to the State Public Service Commission of which it may be called something different in your state. You could file a complaint with them. Or file a complaint with your state attorney generals office, they also take on wireless providers.
    The problem here is the staff you speak to are poorly trained, in days gone by it took one call to them and they pulled up your account and see the error and had the authority to remove any errors. They did not remove legitimate account actions, but used their heads instead of putting a customer off or worse lying to the customer.
    Its a shame you have to go through what you going through.
    Good Luck

  • I am having a strange problem with the awesome bar

    The awesome bar/location bar is no longer as awesome as it used to be. When I start typing in an address it seems like it no longer checks through my history and gives a list of possible matches but just gives the stem of an address. For example, if I type in 'goo' it will complete this to 'google.com' if I then append this with an '/a' it will complete this to 'google.com/analytics' but that's as good as it gets, as I say, no list from the history or bookmarks.
    I've checked the options and also about:config and all the settings are as they should be, as far as I can tell (and I certainly hadn't changed any of them when it started misbehaving). I've also disabled all extensions and plug-ins.
    It's driving my slightly bonkers because I quite often use sites with long addresses and can't remember each of the components of each address. I'd switch to using Chrome but I also use Firebug a fair bit so don't really want to do this.

    Hi cowtan, <br/>Sorry you are having problems with the awesome bar.
    I imagine the new behaviour may be reversed by changing some pref but I have not looked that up.
    Regardless of the new behaviour you seem to have some fault as my awesomebar still gives bookmarked items.
    As a troubleshooting step try adding an asterisk in the awesomebar (as first character or anywhere) that should then filter the results in the dropdown list to bookmarked only items, does that work ?
    * see [[Search your bookmarks, history and tabs with the Awesome Bar#w_changing-results-on-the-fly]]_changing-results-on-the-fly
    You possibly have some extension interfering with the awesome bar, try Firefox in safe mode (but do NOT* at this stage try the Reset Firefox option)
    <nowiki>*</nowiki>'''edit''' - personal opinion, if a user; such as you; is knowledgeable enough to use ''about.config'' the easy solution of ''FirefoxReset ''is probably not the best route, as it can have unwanted side effects that are avoidable.
    * [[Troubleshoot Firefox issues using Safe Mode]]
    Do your bookmarked items appear in safe mode ?
    <u>Try a new Profile.</u><br/>The best method for troubleshooting this will be to set up a new Firefox profile, you can then: experiment, troubleshoot, alter settings or extensions installed in that profile without changing and potentially damaging your current profile.
    * http://kb.mozillazine.org/Profile_Manager#Creating_a_new_profile
    I suggest to prevent unexpected problems you
    * use a sensible name such as test 2012 for the profile name
    * ensure an empty folder is used & do not then rename or delete the new profile (instead add or delete shortcuts to it)
    * also see http://kb.mozillazine.org/Using_multiple_profiles_-_Firefox

  • ITS 6.20 SP18 Problem with the top bar menus

    Hello Henning,
    we're using ITS 6.20 SP18 and experience a problem with the top bar menus in the SAPGUI for HTML (Enjoy Design) in both MSIE 6 and Moz Firefox 1.0.4.
    When clicking the dropdown menus in the top bar the menu simply won't open. This only occurs in all of our homegrown (Z*) services when dropping into SAPGUI for HTML (ITS is in mixed mode). However - When running service WEBGUI seperately (via ...scripts/wgate/WEBGUI/! ) the menus work funnily enough.
    This worked fine prior to the upgrade. Is there a new service parameter that I need to set? Have you got any more documentation? I checked out any related SAPNet notes on the SP18 documentation sheet, but couldn't find anything related.
    Kind regards,
    Michael

    > There is no known problem regarding ITS 6.20 PL 18
    > and the menu at this time. Please provide an example
    > for a service file (.srvc) of one of your Z
    > services and also the global.srvc.
    >
    <u>These are the <b>global.srvc</b> settings</u>
    ~appserver 
    ~client  010
    ~clientcert  1
    ~cookies  1
    ~exiturl 
    ~hostsecure  xxxxxxxxx
    ~hostunsecure  xxxxxxxxx
    ~language 
    ~login 
    ~logingroup  ZZZZZZZZ
    ~menu2002  0
    ~messageserver  xxxxxxxx.xx.xx.xx
    ~multiinstanceservices  1
    ~password 
    ~portsecure  443
    ~portunsecure  80
    ~routestring 
    ~runtimemode  pm
    ~systemname  XXX
    ~systemnumber  00
    ~theme  99
    ~timeout  120
    ~urlarchive  /scripts/sapawl.dll
    ~urlimage  /sap/its/graphics
    ~urlmime  /sap/its/mimes
    ~usertimeout  1
    ~webgui_theme  99
    ~xgateway  sapdiag
    ~xgateways  sapxgadm,sapdiag,sapxgwfc,sapxginet,sapxgbc,sapextauth
    ~rfctimeout     10
    ~noheaderokcode  1
    ~http_use_compression  1
    ~http_compress_level  7
    ~mysapcomnosso1cookie  1
    <u>These are the service settings for one of our <b>Z* services</b>:</u>
    ~AUTOSCROLL     0
    ~COOKIES     1
    ~GENERATEDYNPRO     1
    ~HTTP_COMPRESS_LEVEL     9
    ~HTTP_USE_COMPRESSION     1
    ~LISTSCROLLING     0
    ~LOGIN
    ~PASSWORD
    ~POPUPS     1
    ~STYLE     DHTML
    ~TRANSACTION     Zxxxxx
    ~WEBGUI
    ~WEBGUI_POPUPS     1
    ~WEBGUI_THEME     99
    Kind regards,
    Michael

  • HT1451 I am trying to restore my iphone but its stuck at the apple logo with the progress bar. What should I do?

    I am trying to restore my iphone but it has been stuck at the apple logo with the progress bar and it shows no signs of loading at all. What should I do?

    Hello kuukua.b,
    Thanks for using Apple Support Communities.
    Please try to restart and reset your iPhone by following the steps below, and then resume your restore process.
    Turn your iOS device off and on (restart) and reset
    http://support.apple.com/kb/ht1430
    Take care,
    Alex H.

  • When my Mac battery dies and I turn it back on, it always crashes on the grey screen with the progress bar, then it restarts (taking forever) and does not remember any of the programs I was running. MacBook Pro 13 inch running Mavericks

    When my Mac battery dies and I turn it back on, it always crashes on the grey screen with the progress bar, then it restarts (taking forever) and does not remember any of the programs I was running. MacBook Pro 13 inch running Mavericks

    http://osxdaily.com/2014/10/17/os-x-yosemite-installation-stuck/
    also use the Command-L to view logs during installation

  • HT4623 My iphone had an error while updating and is now locked up on the apple screen with the progress bar

    Itunes was updating my phone from 6.01 to 6.1 and it came up with an error. I closed the error not thinking about it and now my phone is locked up on the apple screen with the progress bar on it.

    hi i tried to update my iphone 3gs from ios 4.1 to 6.1.2, while doing the same i got an error message (-5000) which i ignored an continued. it was almost about to complete while my itunes is not able to detect the iphone kindly help.

  • After a reset of settings on IPad2 it turns "on" but i only get to the logo screen with the progress bar under it. so it turns on to logo then to progress bar screen then off. and repeats over and over

    Well as I said in the "question", I did a reset of the settings on my IPad2. however when it powered back on from resetting. it lets the the logo screen with the progress bar under it. The progress bar gets about 1/4 of an inch from the left then stops. After a few mins Ipad shuts off then turns on to the logo screen, then goes to the logo/progress bar screen, does whats said above, then off. That cycle just repeats over and over. Any help with this would be appreciated.

    Recovery Mode Step by Step
    1. Hold Sleep/Wake button down and slide to turn off iPad
    2. Turn on computer and launch iTune (make sure you have the latest version of iTune)
    3. Plug USB cable into computer's USB port
    4. Hold Home button down and plug the other end of cable into docking port. Do not release button until you see picture of iTune and plug.
    5. Release Home button.
    On Computer
    6. iTune has detected iPad in recovery mode. You must restore this iPad before it can be used with iTune.
    7. iPad Recovery Mode on computer screen
    8. Select "Restore iPad"...
    9. Select "Restore and Update"
    10. Extracting Software.
    11. Preparing iPad for restore.
    12. Waiting for iPad.
    13. Verifying iPad restore...
    14.Restoring iPad software.
    15. Verifying iPad software.
    16. Verifying iPad Restore...
    17. Restoring iPad firmware...
    18. Your iPad is restored to factory settings; keep iPad connected to computer
    19. Activate iPad
    20. Enter Apple ID and Password
    21. Continue
    22. Welcome to Your New iPad
    (a) Set up as new iPad   (b) Restore from this backup (select from list of backups)
    23. Restore from this backup
    24. Continue
    25. Restoring iPad from backup
    26. The settings of your iPad have been restore; keep iPad connected to computer
    27. Syncing iPad (Step 1 to 5)
    28. Preparing apps to sync
    29. Copying 1 of 9
    30. Sync apps, movies and music to iPad
    31. Finishing syncing
    32. Eject iPad

  • My iPhone 4S got stuck on the apple logo with the progress bar!

    Afternoon. My iPhone 4S got stuck on the apple logo with the progress bar! but every time after I restore the 4S the progress bar starts again and stops at different stages of the loading process! Can anyone help with this please?
    All this started happening after I tried to download the lastest update (iOS 7.1). The 4S went and got stuck on the apple logo and progress bar!!

    Hello kuukua.b,
    Thanks for using Apple Support Communities.
    Please try to restart and reset your iPhone by following the steps below, and then resume your restore process.
    Turn your iOS device off and on (restart) and reset
    http://support.apple.com/kb/ht1430
    Take care,
    Alex H.

  • Internet recovery gets stuck on the spinning globe with the progress bar below.

    Hello Everybody!
    I'm trying to fix the iMac (27-inch, Mid 2010) of my friend. He said it doesn't boot anymore and just gets stuck on the grey screen with the Apple logo and the spinning wheel below. So my first step was to go into the Startup Manager by pressing the Option key after the chime. There I was presented with the Macintosh HD and the Recovery HD. After selecting the Recovery HD to access the Disk Utilities I got stuck on the grey screen with the Apple logo and the spinning wheel again. So I guess the data on the drive is corrupted and might have to be replaced. But before I do that, I wanted to give the Internet Recovery a try. I connected the iMac to the internet using an ethernet cable and pressed Command + Option + R after the chime and the spinning globe appeared with the info: "starting recovery process from network. This may take a while". After a short time the sentences are replaced by a progress bar and a timer that is counting up. The progress bar then moved for a tiny little bit and then nothing happens anymore but the timer keeps counting up. I waited for quiet some time before I gave up. I did not get any errors so I can't provide any other useful information. Can anyone give my some advice? I read in other posts that the ISPs of specific countries block ports which are needed for the internet recovery. I'm in Thailand right now. Does anyone know if that might cause the problem?
    Thank you for all your help!

    Neither we nor Apple support jailbroken iDevices.

  • HT4623 so i downloaded the iOS 7 onto my computer. then wanted to upgrade. iTunes is waiting to connect to the phone after the restart. now it's stuck in the black screen with the white apple with the progress bar. then i look to iTunes and found out it s

    so i downlaoded the iOS 7 onto my iTunes. then i wanted to upgrade. the phone is stuck in the black screen with the white apple and the progress bar. next time i click on iTunes, it says my phone "has an error and cnanot update" and now it is stuck on the black screen with the white apple and the progress bar almost finished. hasn't moved in 20 minutes.

    No problem, glad to help!
    Update: my PC USB hub was connected to a USB 3 port, I connected the 30 pin cable directly to my PC, And the restore worked just fine. Restored phone from iCloud backup and seems to be working fine.

  • Problem with "transparent" progress bar

    i am trying to implement a progress bar that monitors a long task. I used the example codes given in the swing tutorial and modified a little to make the progress bar indeterminate.
    However, when the progress bar pops up, it is transparent, except for its title! I have search the forum and tried all the solutions given for this similar problem. My codes are already threaded.
    Here's the excerpt of my codes. I used the LongTask, SwingWorker from the Swing tutorial and adapted ProgressBarDemo to ProgressBarA (only difference is indeterminate).
    uploadData();
    public boolean uploadData() {
    boolean uploadSuccess = false;
    final SomeLongTask someLongTask = new SomeLongTask(dataLoader);
    final Thread pBarThread = new Thread(new Runnable() {
    public void run() {
    JFrame pBar = new ProgressBarA(someLongTask);
    pBarThread.setPriority(Thread.MAX_PRIORITY);
    pBarThread.start();
    // this loop hopes to serve as a blocking,
    // which apparently did not help.
    while (!someLongTask.done()) {
    pBarThread.join();
    System.out.println("main thread yields and sleeps ");
    Thread.yield();
    Thread.sleep(1000);
    uploadSuccess = someLongTask.getSuccess();
    // some more post processing here.
    return uploadSuccess;
    class SomeLongTask extends LongTask {
    DataLoader loader;
    boolean success;
    boolean completed;
    public SomeLongTask(DataLoader l) {
    loader = l;
    lengthOfTask = 1000;
    indeterminate = true;
    public Object actualTask() {
    statMessage = "Loading...";
    success = loader.upload();
    stop();
    // return value is not important here.
    // Just return any dummy value.
    return new String("ok");
    public boolean getSuccess() {
    return success;
    I suspect that after the pBarThread started, the main thread proceeds so fast that the progressBar frame cannot show up properly. But i am not very sure on on to thread the post processing part that should wait for the someLongTask to finish. The blocking loop did not seem to help either. :(
    Pls kindly advise.
    Regards,
    kaikit

    have you tried resetting ipod, cause as far as i know, this is sometimes just a temporary glitch, mine does this.

  • Problem with the progress line in MS Project

    Hi there,
    I have a question about the progress line in MS Project. 
    My boss asked me to see how far we were with the work, so I inserted the column '% Complete' and then the progress line.
    Now my boss has a problem with the layout and I don't know how the fix it. The problem is at line 43 and 44, where the progress line indicates that we are behind on that group of tasks. But is it possible for the progress line to not indicate it on lines
    43 and 44 but only on lines 45 to 50? So my question is if it's possible to make the progress line go down (vertically) over line 43 and 44 instead of jumping to the back? 
    It would be much more simple if I could insert lines 43 ad 44 as text but not as a task, so that it just counts as a title of some tasks but nothing more than that. Is that possible in Project?
    (Lines 45 to 50 are subtasks for line 44, and 44 is a subtask for 43. So line 43 is the main task.)
    Normally there was a picture here but I couldn't upload it because my account is not yet verified... So hopefully you can understand the problem with the text. 
    If anyone could give my some advice or the solution, that would be great!
    Thanks in advance!

    Hi Thunderbal66--
    Basically your activity 43 is late because the sub tasks are also late. Thus MS Project shows the situation by moving the progress line backward. The progress line is automatically displayed based on your project progress, there is no way to manually change
    it unless you update your project.
    I think the question is not there. This is more a matter of project governance and transparency: why not showin that a project is late when it is late and taking the appropriate corrective actions?
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • Problem with a progress bar for downloading attachment

    I display the progress bar for downloading attachments and it works fine … but when I am downloading some attachments I get the exception message:
    Exception in thread "main" com.sun.mail.util.DecodingException: BASE64Decoder: Error in encoded stream: needed 4 valid base64 characters but only got 1 before EOF, the 10 most recent characters were: "Q3w5ilxj2P"
    I found the explanation:
    Certain IMAP servers do not implement the IMAP Partial FETCH
    functionality properly. This problem typically manifests as corrupt
    email attachments when downloading large messages from the IMAP
    server. To workaround this server bug, set the
         "mail.imap.partialfetch"
    property to false. You'll have to set this property in the Properties
    object that you provide to your Session.
    http://java.sun.com/products/javamail/NOTES113.txt
    So I turned off partial fetch:
    Properties props = System.getProperties();
    props.setProperty("mail.store.protocol", "imaps");
    props.setProperty("mail.imaps.partialfetch", "false");
    Session session = Session.getDefaultInstance(props, null);
    Store store = session.getStore("imaps");
    store.connect("imap.gmail.com", "<username>","<password>");this solved the problem ….however the method getInputStream() from the Part class blocks the thread until the attachment is completely downloaded and it is impossible to get the information about the number of bytes which have been already downloaded from mailbox.
    Without this information it is impossible to display the progress bar. So is there a way to obtain this information and display the progress bar?
    Edited by: 911161 on 2012-01-31 10:55

    Try the answer I provided to your post on stackoverflow.com:
    http://stackoverflow.com/questions/9086700/how-to-displaly-progress-bar-for-downloading-attachment

Maybe you are looking for

  • Time out - SOAP Receiver Channel

    Hi All, My Scenario is Database --> PI (7.1) --> SOAP (synchronous) . The WebService is taking around 15 mins for giving the Response back to PI SOAP Adapter.But, because of Time Out at the PI SOAP Receiver adapter , I am getting "INBOUND EXPIRED" er

  • APxpress "N" with Epson 3800 working however, "Add Printers" will not work.

    The System Pref "Add Printer" sees the printer hanging off my AirPort Express N via USB, my network sees the Airport Express fine, I checked under the APEx and it sees the 3800 and it should be fine but When I "ADD" the printer "I am getting this mes

  • Displaying the Oracle Forms 10g

    Hi Everyone, I need help on this one. I am currently running Oracle Forms 10g and I want to display the Calendar object on an item in my module. I have attached the relevant libraries i.e Calendar and added the program units as required so in my modu

  • SetNull() doesn't work?

    The code cs.setNull(i, Types.NULL); doesn't work with the latest 9.2.0.5 JDBC driver. It throws a java.sql.SQLException: Ungültiger Spaltentyp      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)      at oracle.jdbc.dbaccess.DBEr

  • Exchange Difference posting through MM

    Dear Experts, We Procure Assets through Material Managment . we  have created interim asset class in FI and attach Asset number in PO while creating PO. Now scenario is that we procured/imported  Asset through PO and created PO in Foregin Curreny on