How to make use of *progress bar*?

I have a progress bar requirement in my swings project,
i.e on clicking a button, some task should be executed and in parallel to this
progress should run on progress bar in the same frame and soon after this task
gets completed the progress on progress bar should come to an end.
How can i do this in swings?
could any one help me out from this?

How to use progress bar
http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html
If you want an example scroll down to the bottom of the page and download the examples.

Similar Messages

  • How can I use a progress bar in objective c mac

    How can I use a progress bar in objective c mac? I have a code that downloads a file and I want to be able to let the progress bar increase by 1. A bit further on the code (to download the file) it needs to increase again. And so on...
    My code
    -(IBAction) downloadButtonPressed:(id)sender;{
        //get the path to the image that we're going to download
        NSURL *url = [NSURL URLWithString:@"https://www.dropbox.com/s/l6o07m48npxknt4/Cluedo.zip?dl=1"];
        //get the path to documents folder where we're going to save our image
        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        NSString *DocumentsDirectory = [paths objectAtIndex:0];
        NSString *filePath = [DocumentsDirectory stringByAppendingPathComponent:@"Cluedo.zip"];
        //Download the file to memory
        NSData *data = [NSData dataWithContentsOfURL:url];
        NSError *error = nil;
        //Save it on the Documents directory
        [data writeToFile:filePath options:NSDataWritingAtomic error:&error];
        NSFileManager* fm = [NSFileManager defaultManager];
        NSString* zipPath = filePath;
        NSString* targetFolder = @"/Applications"; //this it the parent folder
        //where your zip's content
        //goes to (must exist)
        //create a new empty folder (unzipping will fail if any
        //of the payload files already exist at the target location)
        [fm createDirectoryAtPath:targetFolder withIntermediateDirectories:NO
                       attributes:nil error:NULL];
        //now create a unzip-task
        NSArray *arguments = [NSArray arrayWithObject:zipPath];
        NSTask *unzipTask = [[NSTask alloc] init];
        [unzipTask setLaunchPath:@"/usr/bin/unzip"];
        [unzipTask setCurrentDirectoryPath:targetFolder];
        [unzipTask setArguments:arguments];
        [unzipTask launch];
        //[unzipTask waitUntilExit]; //remove this to start the task concurrently

    Your code really isn't suitable for a progress bar, not a real one anyway. Your code will spend about 99.9% of its time in the method "dataWithContentsOfURL:url". That is not a method you want to use in the real world. It is only for demos or proof of concept exercises. All network operations should be asynchronous. That gives you the ability to gracefully recover when there is a failure and also to do fancy things like display a progress bar and tell the user when the download is complete.
    Once you get the asynchronous download logic working, then you can worry about the progress bar. The first thing you will need is the size of the file. Without that, all you can ever do is an indeterminate progress bar or spinner. If you have the size of the file, then you can keep track of how much of the file you have downloaded and update your progress bar with the percentage complete. Make sure to throttle it to no more than incrementing by 1% at a time. Otherwise, a large file or a file transferred in many small chunks, would waste too much time updating the progress bar for no change.

  • How to make use of the XFList in the Function Bar  of the XML Form Builder?

    Hello:
        Now I am creating blog using the XML Form Builder.
        In the bolg publishing interface of the SDN ,there is a tpoics list ,in this list you can select single or multiples.
        I find the XFList in the Function Bar of the XML Form Builder.But I don't know how to make use of this list?Who can help me?
    lexian
    Thanks a lot!

    In the Attributes of a screen field, there is an attribute called "Groups". This has 4 options for input (4 text boxes)
    SCREEN has 4 fields GROUP1, GROUP2, GROUP3 and GROUP4.
    The first text box under Groups attribute corresponds to SCREEN-GROUP1,
    2nd text box for SCREEN-GROUP2
    3rd text box for SCREEN-GROUP3
    4th text box for SCREEN-GROUP4
    Hope this helps.
    Thanks,
    Balaji

  • Seeking in videos using the progress bar

    Ever since the 2.0 update, seeking using the progress bar seems very sluggish, far from the smooth experience I had using the 1.1.4 firmware. The playback seems to snap to certain points and fast forward to the point I seek to. I updated to 2.0.1 today hoping this issue would be fixed, but not yet. Anybody else experiencing this?

    mine is even worse, after the 2.0.1, video playback is broken. There is no video!!!! but there is audio. This apply to any online video as well like youtube. any facing the same problem? How can i restore to 2.0?
    wan

  • I have 5 html pages that share a common header, footer, and sidebar. how do i use my nav bar to change the content of the body without duplicating a lot of code?

    i have 5 html pages that share a common header, footer, and sidebar. how do i use my nav bar to change the content of the body without duplicating a lot of code? thank you!

    i inherited the website. It’s for a non-profit and is not very
    sophisticated, and neither am I in webdesign. It currently has multiple
    pages that are identical except for that body section, so whenever i change
    the navigation (in the sidebar) I have to update every html page.  I want
    to have one basic page, and just call in the different body content based
    on the link the user selects from the nav bar. How can i do that using a
    script? i am using Dreamweaver.
    ~ in love and light ~
    Jeannie
    On Sat, Feb 7, 2015 at 4:07 AM, Ben Pleysier <[email protected]>

  • How to make use of adjacent data elements within the same buffer

    Hi,
             Does anyone know how to make use of adjacent data elements within the same buffer? To make my question clearly, I would like to give you an example. In my application, I set "sample to read" as 10 which means at each loop 10 data samples will be taken into a buffer. Now, what I would like to do is to do some calculations on adjacent data samples in same buffer. I tried to use "shift register" for this, but it seemed to me that it only can deal with the calculation between data from adjacent loops. In other words, it skips 9 data elements and take the 10th one for the calculation.
             Here I also attach my VI showing what I did.
        Thank you very much in advance,
                            Suksun
    Attachments:
    wheel_encoder_1.vi ‏98 KB

    Hi Suksun,
          I hope you'll forgive me for distilling your code - mainly to understand it better.  I tried to duplicate your logic exactly - which required reversing the "derivatives"-array before concatination with the current samples array.  As in your code, the last velocity is being paired with the first position.  If first velocity is really supposed to be paired with first position, just remove the "Reverse 1D Array" node.
    cheers
    Message Edited by Dynamik on 01-07-2006 03:17 AM
    Message Edited by Dynamik on 01-07-2006 03:19 AM
    When they give imbeciles handicap-parking, I won't have so far to walk!
    Attachments:
    encoder2.GIF ‏14 KB
    encoder2.vi ‏102 KB

  • How can I add a Progress bar to show the "render to JPG" progress?

    Hi everyone, I have a button which renders my component to
    JPG.
    How can I attach a progress bar to show the progress of the
    rendering?
    <mx:Button label="render" click="renderasJPEG ()"/>
    public function renderasJPEG( ):void
    convertToImage( component001, new JPEGEncoder( 100));
    private function convertToImage( object:IUICompon ent,
    encoder:IImageEncod er):void
    var base64string: String = ImageSnapshot. encodeImageAsBas
    e64(
    ImageSnapshot. captureImage( object, 72, encoder));
    var variables:URLVariab les = new URLVariables( );
    variables.encoded = base64string;
    variables.type = "jpeg";
    var request:URLRequest = new URLRequest(" script_saveasima
    ge.php");
    request.method = "POST";
    request.data = variables;
    navigateToURL( request, "_blank");
    Thanks in advance.

    Hi,
    I would have thrown a prompt to the user in the renderasJpeg
    function and removed it in last line of convertToImage function.
    Isn't this what you want?
    Hope this helps.

  • How to make use of SE37- Function Module & how to find out the table?

    Hi ,
    1.Could anyone help me what's this SE37-Function module is all about,How to make use of this?
    For Eg,If i want to delete a BOM permanently from the system then I have to use the Function module CM_DB_DEL_FROM_ROOT_BOM.
    But after giving the particular name what should i do?
    Please help me.
    2.How to find out the respective table for a particular field sya for T code-COGI, T code MFBF,where its values are getting populated.,Please help in this issue.
    Thanks in adavnce for spending some time
    Raj.S

    Hi Raj
    Function Modules
    Function modules are procedures that are defined in special ABAP programs only, so-called function groups, but can be called from all ABAP programs. Function groups act as containers for function modules that logically belong together. You create function groups and function modules in the ABAP Workbench using the Function Builder.
    Function modules allow you to encapsulate and reuse global functions in the SAP System. They are managed in a central function library. The SAP System contains several predefined functions modules that can be called from any ABAP program. Function modules also play an important role during updating  and in interaction between different SAP systems, or between SAP systems and remote systems through remote communications.
    Unlike subroutines, you do not define function modules in the source code of your program. Instead, you use the Function Builder. The actual ABAP interface definition remains hidden from the programmer. You can define the input parameters of a function module as optional. You can also assign default values to them. Function modules also support exception handling. This allows you to catch certain errors while the function module is running. You can test function modules without having to include them in a program using the Function Builder.
    The Function Builder  also has a release process for function modules. This ensures that incompatible changes cannot be made to any function modules that have already been released. This applies particularly to the interface. Programs that use a released function module will not cease to work if the function module is changed.
    Check this link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
    You can execute function module in SE37ie you can perform the activiites defined in the function module by executing it.
    By deleting BOM you mention the FM name in se37 and execute. In some function module it will ask input parameters as developed in the program , you have to give the input parameters and execute.

  • How to make use of BAPI_CATIMESHEETMGR_CHANGE

    Hi All,
           We need to make use of BAPI_CATIMESHEETMGR_CHANGE for changing entered hours against an activity instead of adding new row for the same(BAPI_CATIMESHEETMGR_INSERT does that ) . Please guide me what all table parameters we should supply while executing this FM.
    Regards,
    Ganga.

    Hi Senthil,
    Now I have got how to make use of BAPI insert and change. But problme is when I need to add an hours entry for , say tuesaday of activity A for which already HAS monday hours,I am using  BAPI_CATIMESHEETMGR_INSERT AND IT IS ADDING ONE MORE ROW AS SHHOWN BELOW
    . But it adding new row. How top overcome this.
    <b>       Monday
          A     2</b>
    After insert
    <b>      Monday  Tuesday
          A     2
          A            3</b>
    =----
    SHould I use delete and insert.
    Please help me..;
    Regards,
    Ganga
    Message was edited by:
            Gangadharayya Hiremath
    Message was edited by:
            Gangadharayya Hiremath

  • How to make use of the presentation variable in SQL result query

    I have 2 prompts in my dashboard.
    Prompt1 decides the values of Prompt2.
    I have set a presentation Variable (selected_comp) in prompt1 which holds the value selected.
    To populate the values for Prompt2, I need to execute a query using the presenation variable set by Prompt1.
    SELECT "List Of Values".RID from rocketv2_3 WHERE "List Of Values".NAME='COMPONENT' AND "List Of Values".VAL=@{selected_comp}
    the query is resulting into
    SQL Issued: SELECT "List Of Values".RID from rocketv2_3 WHERE "List Of Values".NAME='COMPONENT' AND "List Of Values".VAL=0
    but the value in selected_comp is "ABC".
    Can anybody help in how to make use of the presentation variable in query to get the correct value
    thanks
    Shubha

    Just use constrain check box to filter your 2nd prompt values based on the 1st prompt.
    Thanks,
    Venkat
    http://oraclebizint.wordpress.com

  • How to make use of classlocator in NWDS.

    Hi Experts,
    I don't have Class / jar Locator.
    I am unable to install from SourceForge Website, it is showing some error.
    where can i get it ?
    And how to make use of classlocator in NWDS.
    Help me out in this regard.it's urgent
    Regards
    Bala

    Hi Balakrishna,
    You can download the  classlocator  from this URL:
    http://www.filewatcher.com/b/ftp/ftp.heanet.ie/mirrors/download.sourceforge.net/pub/sourceforge/c/cl/classlocator.0.0.html
    Check this thread for more help
    How to use classlocator plugin?
    Thanks n Regards
    Santosh
    Reward if helpful !!!

  • How to make use of label printing in sap smartforms

    Hi Dear,
    How to make use of label printing in sap smartforms.. I need to print four records from internal table into sap smart forms. It will
    come as four labels.All page should follow the same procedure... How to do...please help me..
    Regards,
    Nikhil

    Hi,
    Please go through below link, would be helpfull for you.
    [http://help.sap.com/saphelp_nw04/helpdata/EN/6b/54b4b8cbfb11d2998c0000e83dd9fc/frameset.htm]

  • How to make use of 'Icon Name' in Logical link?

    I see the option 'Icon name' in 'define logical links' in SPRO. It does not however has an F4. I tried giving the name of image in the relevant skin. But no image appears besides the logical link. Is there something else that needs to be done to get an image besides workcenter link? How to make use of this 'Icon Name' in logical link?

    Hi,
    i guess this icon_name is not possible for every skin in CRM70.
    We use nova skin - here it is not possible.
    With default skin i saw icons for example on the salespro startpage.
    Kind regards
    Manfred

  • How to make use of 32bit packages on Arch64

    Hello everyone, I recently installed arch 64bit which was not yet fully tweaked to suit my needs. 
    My 32bit version has some nice apps and I would like to know how to make use of them or even reuse them so that I won't download things anymore because I have a slow internet connection...:)
    Arch x86_64 / XFCE4
    Thanks in advance
    Last edited by kaola_linux (2008-12-09 15:24:36)

    kaola_linux wrote:
    Hello everyone, I recently installed arch 64bit which was not yet fully tweaked to suit my needs. 
    My 32bit version has some nice apps and I would like to know how to make use of them or even reuse them so that I won't download things anymore because I have a slow internet connection...:)
    Arch x86_64 / XFCE4
    Thanks in advance
    You can reuse the packages in /var/cache/pacman/pkg/ on your  Arch32.
    You can use these saved packages in a 32bit chroot ENV on your Arch64. Just pacman -U all of them.

  • How to make use of StreamGobbler?

    Hi,
    I want to redirect the out and err statements to a file.
    I found a class called StreamGobbler at http://www.physionet.org/physiotools/puka/sourceCode/puka/StreamGobbler.java
    I dont know how to make use of it as I have almost no knowledge of Concurrency and threads in Java.
    Plz guide.

    I found a class called StreamGobbler at
    http://www.physionet.org/physiotools/puka/sourceCode/p
    uka/StreamGobbler.javaDo you see, at the very top of that page, the URL for the original article? It explains everything step by step in great detail.

Maybe you are looking for