Progress bar while downloading data

I want a progress bar showing while I'm downloading data. This seems like a simple thing but I can't figure it out. If I show() the progress bar before and/or during the download it becomes a blank frame. I should probably use a thread, but I don't know the best way to go about it. Any suggestions?

Any suggestions?Maybe try looking at the javadocs?:
http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JProgressBar.html
which would have led you here:
http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html

Similar Messages

  • Show Progress Bar while Accessing data from Server

    Hi,
    I need a Progress bar to be displayed when my application triggers database to backup, As the data would be large progress bar makes sense to display the time span.
    I need a progress bar in place to show the progress of the task,
    Can anyone suggest me how to do this? This should be shown when i backup my database from WPF.
    I have code written for server side and just need a progress bar and timer.
    Thanks,
    Shreyas M

    You could use a BackgroundWorker. There is a complete code sample available on MSDN here:
    https://msdn.microsoft.com/en-us/library/cc221403(v=vs.95).aspx. You do the long-running work, i.e. the actual backup, in the DoWork event handler.
    Note that you will need to report the progress (by calling the ReportProgress method of the BackgroundWorker) and calculate the total time it will take to complete the backup operation yourself.
    It might be easier to just display some "waiting" element and no progress bar during the time it takes for the operation to complete:
    <!-- replace this with any element like for example an Image -->
    <TextBlock x:Name="loadingElement" Visibility="Collapsed">please wait...</TextBlock>
    loadingElement.Visibility = System.Windows.Visibility.Visible;
    System.Threading.Tasks.Task.Factory.StartNew(() =>
    //call your backup method here (this code is being run on a background thread....
    .ContinueWith((t) =>
    loadingElement.Visibility = System.Windows.Visibility.Collapsed;
    }, System.Threading.CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext());
    After all you probably don't know how long time it will take for the method to complete, right? If you want to display a ProgressBar, the backup method should report the progress somehow. If you just call a method and wait for it to complete, you have no
    idea of how long time it will take for the method to return. You will then have to estimate the actual time and then increase the value of the progress bar accordingly.
    There is no way to find out before hand exactly how long time it will take until a method returns so it is the responsibility of the (backup) method to report to the caller how long time it needs and how long time is left until it is done. Far from all API:s
    support reporting progress.
    As you see in the BackgroundWorker example on MSDN, you could call the ReportProgress once in each iteration of a loop but if there is no loop in your Backup method you better just display a busy indicator without a progress bar since you don't know anything
    about the progress anyway.
    Edit: You could of course also display a ProgressBar element with its IsIndeterminate set to True. Just replace the TextBlock and use the sample code above:
    <ProgressBar x:Name="loadingElement" IsIndeterminate="True" Height="50"/>
    Setting this property to true is useful when you don't know how long time the operation will take: 
    https://msdn.microsoft.com/en-us/library/system.windows.controls.progressbar.isindeterminate(v=vs.110).aspx
    Hope that helps.
    Please remember to mark helpful posts as answer to close your threads and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

  • Looking for the progression bar when downloading data

    We are accessing firefox via a compression software, Xgate. The data we download most is a shortened version of the 4day weather charts. There is a way to lower the quality of the detail( a bloke showed us but he is no longer available), but we can't find it. it was a movable bar which could be adjusted with the mouse. Please help At present the page continually upgrades until it is perfect. Less than perfect will do for our needs.
    Regards,
    Dai.

    Hi,,,,
    Double # (##) means the file is tab delimited.
    When you download the file from application server use cl_abap_char_utilities=>horizontal_tab to split fields into separate variables.
    Using this variable populate a ITAB then upload it to presentation server.
          CLEAR: p_l_string.
          READ DATASET p_fname INTO p_l_string.
        EOF reached
          IF sy-subrc <> 0.
            EXIT.
          ELSE.
            CLEAR: wa_final,
                   l_length.
            IF  l_count <> '1'.
                SPLIT p_l_string AT c_tab INTO wa_final-char_c
                                               wa_final-value
                                               wa_final-desc
                                               wa_final-ldesc.
                IF wa_final-char_c IS NOT INITIAL.
                  l_char_c = wa_final-char_c.
                ENDIF.
                wa_final-char_c = l_char_c.
                APPEND wa_final TO  i_final.
              ENDIF.
          ENDIF.

  • Displaying an Indeterminate Progress Bar While a DB2 Stored Proceedure Runs

    How do I display a dialog with an indeterminate progress bar while a DB2 query runs? Could anyone point me to an example or some strong docs?
    I learned Java about six months ago, so I'm relatively new to the language. Through searching and documentation, I've been able to find all the examples and answers I've needed so far. Now I've run into an issue I can't find anywhere. It seems like the most basic thing in the world. I have a DB2 stored procedure that takes about 5 minutes to run. While it's running, I want to display a simple dialog with a progress bar going back and forth (no buttons, no user interaction).
    I'm using Eclipse 3.3.1.1 as my IDE, and running the application from a JAR file. I have Java 1.6.0.30 installed. The DB2 query is running in response to a user clicking a button on the form (an ActionEvent). All of my forms are using Swing (JFrame, JDialog, etc.).
    The crux of my problem seems to be that I can bring up a dialog (which should contain the progress bar), but I can't get it to paint. All I get is a window that's the right size/location, but contains an after-image of what was behind it. I can't even get a dialog to display with a "Please Wait" label while the DB2 procedure runs.
    I tried separating both the DB2 stored procedure and the progress dialog into separate threads. I tried yielding in the DB2 thread to give the progress dialog a chance to update. I tried using invokeAndWait, but I got the following error:
    Exception in thread "AWT-EventQueue-0" java.lang.Error: Cannot call invokeAndWait from the event dispatcher thread
    It seems like I'm doing something wrong in my use of Theads, but I can't for the life of me figure out what it is. If anyone could help out a bit of a Java newbie, I would be extremely grateful.

    Demo:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class ProgressBarExample2 {
        private JProgressBar bar = new JProgressBar(0,99);
        private JButton button = new JButton("Lengthy operation");
        private ActionListener al = new ActionListener(){
           public void actionPerformed(ActionEvent evt) {
                button.setEnabled(false);
                bar.setIndeterminate(true);
                new Worker().execute();
        private class Worker extends SwingWorker<Boolean, Boolean>{
            protected Boolean doInBackground() {
                try {
                    Thread.sleep(10000); //10 secs
                } catch (InterruptedException e) {
                return Boolean.TRUE;
            protected void done() {
                button.setEnabled(true);
                bar.setIndeterminate(false);
        public static void main(String[] args) {
            EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new ProgressBarExample2();
        ProgressBarExample2() {
            button.addActionListener(al);
            JPanel cp = new JPanel();
            cp.add(button);
            cp.add(bar);
            JFrame f = new JFrame("ProgressBarExample2");
            f.setContentPane(cp);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.pack();
            f.setLocationRelativeTo(null);
            f.setVisible(true);
    }

  • 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

  • PROGRESS BAR while loading report

    Hi Fiends,
    I have a classic report w/ a link and this link open a other page and this page is a report with a report model ( CSV ).. and this load is too slow and i wanna include a progress bar like this site [link]http://apex.oracle.com/pls/otn/f?p=987654321:26[link] and this progress bar will be show while the report is loading ...
    Anybody knows how to do this ?
    Tks
    Zander

    Hi,
    Have you seen :
    [url http://apex.oracle.com/pls/otn/f?p=65560:2:0::NO] Loading Icon plugin
    [url http://www.apex-plugin.com/oracle-apex-plugins/dynamic-action-plugin/loading-icon_81.html]Click here to see the features and download
    And I think that it is good to check [url http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_plsql_job.htm#AEAPI1203]APEX_PLSQL_JOB
    Regards,
    Fateh
    Edited by: Fateh on Sep 22, 2012 1:26 AM

  • How can i Create a PROGRESSIVE BAR   while process of a procedure is going

    hi,
    I have a push button in my form that runs the procedure .the process will approx 15 minutes. while processing is started, i want to display PROGRESSIVE BAR
    until process complete and exits automatically after process . please suggest me how to create the same, is it possible..
    please send me solution as soon as possible please
    thanks in advance
    prasanth

    The forms demos contains a progress bar bean which you can use if web deployed.
    Regards
    Grant Ronald
    Forms Product Management

  • Error while downloading data Using RSCRM_BAPI

    Hi Folks,
    I am getting the below mentioned error message while downloading the data from BW report to csv file using RSCRM_BAPI.
    Can anyone help on this error ?
    Internal error in method CHECK_TABLE_NAME (RSCRMBW_EX_NAMESPACE_GET)

    hi lakshmi:
    I also tried to use this t-code. but this has lots of restrictions..and its not recommended to use this t-code for complex queries.There are OSS NOtes out there for restrictions for this t-code.
    I got to know from other forums on SDN that there is other RSCRMBW_REPORT FM. which is better to use. but not able to use it... there is specific way for that FM. If you try that and if it works for you please let me also know.
    Also, try to look at this forums:
    Error Using RSCRM_BAPI T-Code
    Problem with RSCRM_BAPI (extraction to Fixed Lenght txt file)
    RSCRM_BAPI Schedule and monitor
    RSCRM_BAPI
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3ba5e590-0201-0010-59b1-cab51fd245b7
    Hope this helps.
    KSmith

  • Error while downloading data into excel file.

    Hi,
        I have a requirement to download data available in xstring to excel file.
    I have a RFC which has export parameter 'file_data' of type xstring. When i call RFC
    from web dynpro abap application it gives data out pout in xstring format.
    I am opening excel file using that xstring data as below
    cl_wd_runtime_services=>attach_file_to_response(
    i_filename = 'file.xls'
    i_content = ls_data_source-data_source   ***[xstring data from RFC]
    i_mime_type = 'x-excel/application'
    i_in_new_window = abap_true ).
    But excel file not coming in correct format. its  giving an error while download
    excel file
    Error is
          " the file you are trying to open , 'file[1].xls', is in a different format than
    specified by the file extension. Verify that the file is not corrupted and is from
    a trusted source before opening the file. Do you want to open the file now? "
    If i click on 'YES' button file opening but not in proper excel format. Data is coming
    in tab delimiter format in excel file.
    Please suggest any solution for this problem.
    Thanks,
    Venkat.

    Hi Thomas,
    Following is the logic implemented in RFC which is giving XSTRING as export parameter
    STEP1      create a dynamic internal table
               Create field catalog for the table   using LVC_FIELDCATALOG_MERGE
                   CALL METHOD cl_alv_table_create=>create_dynamic_table
                        EXPORTING
                           it_fieldcatalog = it_fieldcat
                         IMPORTING
                           ep_table        = dyn_table.
                  CREATE  EXCEL SHEET BY SENDING FIELD CATALOG AND DATA TAB
    STEP2 # Convert text table to xstring.
            CALL FUNCTION 'SCMS_TEXT_TO_XSTRING'
              IMPORTING
                buffer   = l_content
              TABLES
                text_tab = lt_data_tab
              EXCEPTIONS
                failed   = 1
                OTHERS   = 2.
    STEP3  *# Psss Data to Netweaver
              PERFORM pass_data_to_nw USING is_import
                                      CHANGING es_attachment_metadata.

  • Creating a progress bar while querying a report in Visual Studio

    I have created a Visual Studio 2013 program that runs reports from a SQL server.  I want a progress bar to show up in my VS program while it is querying so my user doesn't think that it is frozen while running larger queries.  How can I do this.
     Step by step is better since I am new to programming.
    Gracies 
    Much Love 

    Hi flextera,
    Based on your description, I’m afraid that it is not the correct forum for this issue, since this forum is to discuss:
    Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor.
    To make this issue clearly, would you mind letting us know more information about this issue? Which language are you using? Which kind of app are you developing? You said that it is related to the report in SQL Server, is it the SSRS issue or the specific
    windows app like the WinForms app?
    Please share me more information, I will help you find the correct forum for this issues.
    If there's any concern, please feel free to let me know.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • No progress bar while music is playing?

    since i've upgraded my 3g to 2.2, i've noticed that while music is playing, there is no progress bar @ the top(like the volume bar @ the bottom).
    my g/f also has her iphone 3g running 2.2, but her progress bar is still there, along with the little genius logo, which i also no longer have...
    is this a setting issue, or a firmware problem?
    as a DJ, its helpful to have the progress bar so that i can skip thru a song
    thanks for any help

    Tap the artwork while the song is playing to display the additional controls.
    See http://manuals.info.apple.com/enUS/iPhone_UserGuide.pdf, page 63.

  • Progress bar while calling reports from Forms

    I have got a form (FORMS 6i) which calls a report (Reports 6i). This call results in the invocation
    of a reports engine which might take time (may be more than a minute) in bringing up the desired report. Is there any way i can show a progress bar to the user (like in any Windows application) that the report is getting generated? Because the user is currently confused on whether the report is really generated or not while waiting for the report.
    Thanks in advance
    PRS

    I have got a form (FORMS 6i) which calls a report (Reports 6i). This call results in the invocation
    of a reports engine which might take time (may be more than a minute) in bringing up the desired report. Is there any way i can show a progress bar to the user (like in any Windows application) that the report is getting generated? Because the user is currently confused on whether the report is really generated or not while waiting for the report.
    Thanks in advance
    PRS

  • Error while downloading data

    Hi,
    While downloading the data(Huge) using the custom program
    its given the following error in background JOB LOG.
    Actually this program takes data from the UNIX server and created XL sheets.
    Can any one help me............
    Problem:
    A RAISE statement in the program "SAPLSFES " raised the exception   
    condition "CONTROL_FLUSH_ERROR".                                    
    Since the exception was not intercepted by a superior program       
    Thanks
    eswar

    Hi,
    so far as i know, there're restrictions from your frontend  with gui_download
    try to increase your virtual memory and look in oss
    Andreas

  • Progress bar while loading table

    Hi, please could anyone help me to how to create progress bar when i am loading large number of data using bean. data would be unknown so how do i show the status...plz help..
    thanks

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

  • Show progress bar while module loads

    I have a TabView where each tab is a module. One of the
    modules has a lot of child components and when I click to activate
    that tab - it takes 2-3 seconds to load. During this time OSX shows
    the beach ball.
    Is it possible for me to show a loading progress bar instead?
    Should I be pre-loading all the modules when the application loads,
    or at some other point? If so, how do I do this?
    Any suggestions would be appreciated.

    Hey Jason,
    I'm not sure who moderates, but I can send you in the right
    direction.
    Short answer: Look around for Asynchronous Flex demos
    Long answer:
    The interfaces locks up (beach ball/hour glass) because the
    main application 'thread' is busy with the task you asked of it.
    This can, in many different languages, cause a freeze. Javascript,
    Native Mac or Windows applications, apparently Flex too.
    Running one task at a time is considered a synchronous
    (serial) request. What you need to do is make an asynchronous
    (parallel) request. In the web world, that's the 'A' in Ajax. By
    making asynchronous requests, you free up the main 'thread', while
    a separate worker thread is off completing the task. This keeps
    your interface responsive.
    I think that leads to event listeners.. Send off a background
    request, but listen for it to complete. Link the listener to a
    second piece of code upon successful completion.
    I wish I could get into more detail, but I'm not a Flex guy..
    hoped that at least helped gel the idea.
    -dp

Maybe you are looking for

  • Limit the amount of tasks that a user can claim

    I have a custom worklist and I need to develop a requirement for not allowing the users to claim more than one task at a time. Does the Worklist API have something to limit the amount of tasks that a user can claim at a time?. Thanks in advance. Neuq

  • Condition types in orders

    Hi,       I want to find out in what all sales orders a particular condition type was used. For example there is a condition type k005, now i want to find out in what all sales orders this condition type was used.      Useful responses are highly app

  • Plug in to computer

    when i plug my dx into my computer the reboots it self.

  • OSX 10.6.8 & Safari 5.1.7 wont recognize flash.  Maddening.

    Any help here would be appreciated.  This is my wife's notebook and I'm not exactly a mac guy to to PCs at work, so please keep that in mind walking me through this! In any event, sites such as YouTube keep saying "The adobe flash player is required.

  • Languages (Where do I start?)

    Hi, I am currently studyng programming at a college, since we're learning from basics, we're learning C and C++. I was hoping you could suggest me a language to learn by "myself", something like Python or Java. I am really an ignorant to mostly anyth