PROGRESS BAR , URGENT ....

I have a backend process which takes 15 minuites to complete. Now when the user starts the process, I want to show in the front end form a progress bar . So as soon as the user hits the button to start the process, the progress bar will start and when the process will complete it ll complete. Any one knows how to achieve this ?
A sample code is appreciated.
Thanx
Feroz

I found a way to display a progress bar.
I draw a red filled rectangle (named for example PROGRESS_BAR on the canevas). For example set the width of this rectangle to 200. And I draw also an empty rectangle to show the border of the first one
Now calculate the number of iterations you make during your process : for example if you loop on the records of a table, count the number of records.
Let's say you have n = 1000 iterations
and the size of the rectangle is length = 200
DECLARE
n_cpt NUMBER := 0; -- loop counter
n_step NUMBER;
BEGIN
-- At the beginning of the process, make the rectangle visible :
set_item_property('PROGRESS_BAR', DISPLAYED, PROPERTY_TRUE);
-- set the size to zero
set_item_property('PROGRESS_BAR', WIDTH,0);
-- for example if you want to refresh
-- the progress bar by 5%
n_step := n * 0.05;
-- you will refresh after 1000 * 0.05 = 50 -- loops
LOOP
-- test if the occurrence can by divided
-- by n_step
IF (n / n_step ) = ROUND( n /n_step) THEN
set_item_property('PROGRESS_BAR', WIDTH,
n / n_step * 200 * 0.05);
-- for example if n = 500 you will have
-- a width of 500 / 50 *200 * 0.05 = 100
-- it's the half of the initial width
-- of 200 and shows the user that you
-- have processed half of the records
END IF;
-- increment loop counter
n := n +1;
..... rest of your code
END LOOP;
message('end of process');
-- hide the progress bar
set_item_property('PROGRESS_BAR', DISPLAYED, PROPERTY_FALSE);
END;
null

Similar Messages

  • URGENT: progress bar update problem

    Hi,
    I have the following problem: I have a JWindow that displays as a Splash screen at the start of my application. On that I have a progress bar that updates upto 60% (there is no task associated with it, I simply create a thread that does this). In the main thread, i wait for this thread to complete and then display a login dialog box on top of the splash screen. At this time, the progress bar is not increasing.
    After logging in correctly, I wish that the login dialog box be disposed, and i should be able to see the progress bar reach completion, after which i want a JFrame to be displayed with a lot of components, and after this JFrame is displayed, i want the splash screen to be disposed.
    However, the progress bar updates itself properly till the login dialog is displayed. when i click enter on the dialog box, although i have called dispose, the part of the dialog box over the splash screen reamins visible, and the progress bar is no longer updated. I have printed System.out.println statements in the run part of the thread doing the update, and this shows that the progress bar value goes on to reach 100. but the GUI is not updated.
    Can any1 explain why this is happening? Any help inthis matter would be highly appreciated... Pls reply URGENTLY!!! i've already spent three days looking into this!!!
    Thanks...
    Shefali Panchal

    Caution with using threads to update the display -
    look at the Swing __utility__ class methods, I seem to remember that
    there are 2 methods in which you pass a thread instance
    (which can contain display update calls)and this is called and maintained within the event despatch thread - this should mean
    that display updates are done correctly.
    Refer to Swing documentataion with regard to utility methods
    Hope this is of help

  • URGENT pROGRESS BAR ERROR

    Hi huys,i am a 2nd year Computer Programming Student.we have to make a game where there are two players.a random no is generated to get the progress bar to 100.the player who reaches 100 first wins the game
    i can the random part right,but it is stuck on a number.it does not go all the way to 100
    please look at my code if possible
    import java.awt.BorderLayout;
    import java.awt.Container;
    import javax.swing.BorderFactory;
    import javax.swing.JFrame;
    import javax.swing.JProgressBar;
    import javax.swing.border.Border;
    public class ProgressSample {
    public static void main(String args[])
    JFrame f = new JFrame("JProgressBar Sample");
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container content = f.getContentPane();
    JProgressBar progressBar = new JProgressBar();
    double val = (Math.random()*10)+1;
    int val2 =(int)val;
    // int val2 = Integer.parseInt(val);
    int counter = 0;
         counter = counter + val2;
    for(int i = 100;i >= 0;i++)
    progressBar.setValue(counter);
    progressBar.setStringPainted(true);
    Border border = BorderFactory.createTitledBorder("Reading...");
    progressBar.setBorder(border);
    content.add(progressBar, BorderLayout.NORTH);
    f.setSize(300, 100);
    f.setVisible(true);
    Thanks
    Lisa

    Spot the difference -
    http://forum.java.sun.com/thread.jspa?threadID=671082&messageID=3922924#3922924
    http://forum.java.sun.com/thread.jspa?threadID=671079&messageID=3922913#3922913
    http://forum.java.sun.com/thread.jspa?threadID=671071&messageID=3922883#3922883
    http://forum.java.sun.com/thread.jspa?threadID=670979&messageID=3922285#3922285
    http://forum.java.sun.com/thread.jspa?threadID=670980&messageID=3922291#3922291

  • Urgent!! progress bar

    hi,
    i want to display the opening of the file/downloading a image using the progress bar.i'd certainly appreciate if anyone can give me the code,
    thank you for your time and concern,

    Here is an unfinished example for a progressBar.
    At this time it's have a two "bug":
    -after the maximum value is reached the ProgressBar
    is no longer painted on screen
    -I intended to use it with absolute coordinates
    I don't think this is the best example but I hope it will help you.
    If you solve the problem, please tell me too.
    A better version you'll find on SWING.
    import java.awt.*;
    import java.util.Date;
    import java.applet.*;
    class ProgressBar extends Canvas
    private int maximumValue;
    private int minimumValue;
    private int actualValue;
    private int progressWidth;
    private int progressHeight;
    private int progressX; // from where begin to draw
    private int progressY;
    private float progressScale;
    private Date startTime;
    private boolean showTheTime=false;//show the elapsed time
    private Image offScreenImage;
    private Graphics offScreenG;
    private Graphics g;
    private Font f;
    private FontMetrics fm;
    private Component myComponent;
    ProgressBar (int valueMin,int valueMax,int xStart,int yStart,int width,int height,boolean isCounterShowed, Component component)
    minimumValue=valueMin;
    actualValue=valueMin;
    maximumValue=valueMax;
    progressWidth=width;
    progressHeight=height;
    progressX=xStart;
    progressY=yStart;
    showTheTime=true;
    progressScale=(float)maximumValue/(float)progressWidth;
    startTime=new Date();
    myComponent=component;
    g=myComponent.getGraphics();
    offScreenImage=myComponent.createImage(progressWidth+1,progressHeight+1);
    offScreenG=offScreenImage.getGraphics();
    if(showTheTime==true)
    f=new Font("TimesRoman",Font.BOLD,progressHeight-4);
    offScreenG.setFont(f);
    fm=offScreenG.getFontMetrics();
    public void setValue(int valoare)
    if ((valoare) != actualValue && valoare <=maximumValue)
    actualValue =valoare;
    paint(g);
    // calculating and formating the elapsed time
    private String formatTime()
    Date currentTime=new Date();
    String returnString ;
    int minute;
    int seconds;
    int startM=startTime.getMinutes();
    int startS=startTime.getSeconds();
    int currentM=currentTime.getMinutes();
    int currentS=currentTime.getSeconds();
    if(currentM>=startM)
    minute=currentM-startM;
    else
    minute=60+currentM-startM;
    if(currentS>=startS)
    seconds=currentS-startS;
    else
    seconds=60+currentS-startS;
    minute -=1;
    if(minute<10)
    returnString="0"+Integer.toString(minute);
    else
    returnString=Integer.toString(minute);
    if(seconds<10)
    returnString += ":0"+Integer.toString(seconds);
    else
    returnString += ":"+Integer.toString(seconds);
    return returnString;
    public void update(Graphics g)
    g.setClip(progressX,progressY,progressWidth, progressHeight);
    paint(g);
    public void paint(Graphics g)
    offScreenG.setColor(Color.lightGray);
    offScreenG.fillRect(0,0,progressWidth,progressHeight);
    // drawing the ProgressBar border (etched border)
    offScreenG.setColor(Color.darkGray);
    offScreenG.drawLine(0,0,progressWidth,0);
    offScreenG.drawLine(0,0,0,progressHeight);
    offScreenG.setColor(Color.white);
    offScreenG.drawLine(progressWidth,0,progressWidth,progressHeight);
    offScreenG.drawLine(0,progressHeight,progressWidth,progressHeight);
    offScreenG.setColor(Color.white);
    // drawing
    offScreenG.setColor(Color.blue);
    offScreenG.fillRect(1,1,(int)((float)actualValue/progressScale)-1,progressHeight-1);
    // if the height <20 the "elapsed time" is not showed
    if(progressHeight>=20 && (actualValue < maximumValue))
    offScreenG.drawString(formatTime(),(progressWidth-fm.stringWidth("00:00"))/2, progressHeight-4);
    g.drawImage(offScreenImage, progressX,progressY,this);
    offScreenG.dispose();
    // a class to test ProgressBar
    public class testProgress1 extends Applet implements Runnable
    Thread myThread;
    ProgressBar pb;
    Graphics g;
    public void init()
    g=getGraphics();
    setBackground(Color.lightGray);
    resize(800,300);
    add(pb =new ProgressBar(10,200,25,25 ,700,60,true,this) );
    public void start()
    if(myThread==null)
    myThread=new Thread(this);
    myThread.start();
    public void delay(int time)
    try
    myThread.sleep(time);
    catch(InterruptedException e)
    public void run()
    for(int i=0;i<200;i++)
    pb.setValue(i);
    public void update(Graphics g)
    paint(g);
    }

  • Progress Bar in Datagrid in flex

    Hi,
    I have a urgent requirement, which needs to have ProgressBar
    in DataGrid. I want to set progress for each of the ProgressBar in
    datagrid to be binded to a cloum (i.e your progress bar column is
    binded to some object in array collection). Please do let me know
    how this is possible. It would be great favour if it is possible to
    do it using manual mode.
    I used following mxml
    <mx:AdvancedDataGridColumn id="teamProgress" width="120"
    headerText="Team" dataField="TeamProgress">
    <mx:itemRenderer><mx:Component><mx:HBox
    verticalAlign="middle"> <mx: ProgressBar id="PB"
    trackHeight="13" barColor="red" trackColors="[White, haloSilver]"
    borderColor="black" width="75" textAlign="right"
    styleName="progressBar" mode="manual" label="data.TeamProgress"
    height="13"/></mx:HBox></mx:Component></mx:itemRenderer>
    </mx:AdvancedDataGridColumn>.
    How to support static binding of the progress bar column of
    DataGrid to some object in ArrayCollection.
    I want this progress bar column to be clickable.

    Hi,
    Please find the code for implementing a progress bar in
    DataGrid at the URL below. You will find code for sample
    application which is using Adobe share API. In this application
    they implemented a progress bar in a DataGrid.
    https://share.acrobat.com/adc/document.do?docid=fa29c796-dc18-11dc-a7df-2743035249fa
    Hope this helps.

  • Progress bar in my JSP

    I HAVE A JSP THAT TAKE SOMETHING OF TIME IN RUN DATABASE QUERIES, I NEED TO SHOW A PROGRESS BAR WHILE ITS RUN .
    HOW I DO THIS ? IN JAVASWING OR JAVASCRIPT? I NEED IT URGENT.
    I NEED TO KNOW HOW DO MY PROGRESS BAR.
    THANKS

    stop yelling...
    This thread:
    http://forum.java.sun.com/thread.jsp?forum=45&thread=443328
    the 1st reply has some code I've used to do something similar. You could have it write out some Javascript stuff to update a progress display if you wanted. Otherwise it'll just block til the thread is done. You'd have to write the worker thread. It also uses struts stuff, but you should be able to figure out how to remove those parts.

  • Progress bar after button click ------ code included . need help

    Hi,
    this is my code. i want the progress bar to move after i click the OK button but its not working. Need help urgently.
    public class LoggenGUI extends JFrame implements ActionListener{
    private JButton btnOk;
    private JProgressBar current;
    public LoggenGUI() {
    super("Login");
    this.setBounds(350,225,350,235);
    // this.setSize(300,300);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.setResizable(false);
    this.btnOk = new JButton("Ok");
    // associating action event listener to it
    this.btnOk.addActionListener(this);
    this.current = new JProgressBar(0,2000);
    this.current.setValue(0);
    this.current.setStringPainted(true);
    this.setContentPane(pane);
    this.setVisible(true)
    }// end constructor
    public void iterate(){ 
    while(this.num < 2000){
    this.current.setValue(this.num);
    try{
    Thread.sleep(1000);
    }catch(InterruptedException e)
    this.num= this.num + 200;
    if(this.num >= 2000)
    this.dispose();
    this.prgrBar = new ProgressBar();
    this.current.setStringPainted(true);
    public void actionPerformed(ActionEvent evt){
    Object source = evt.getSource();
    if(source == this.btnOk){    this.iterate();    }
    } // end class

    You keep posting this question every day. Do you
    think you are going to get a different answer each
    time you posted it without reading what others have
    told you to do!"Insanity: doing the same thing over and over again and expecting different results." --- A. Einstein

  • Help needed please, with Iphone stuck with apple picture and progress bar after software update attempted

    Help needed please, everytime I try to update the software version on my iphone it comes up with a message saying it could not be completed and is now frozen with the apple picture and progress bar on it. Do I unplug it and hope the macbook pro sees it again, I also stupidly did not back up before starting the download which I realise I will have to go back to the previous back up. This keeps happening, everytime I do this type of update, I'm starting to think I should just give up on updating my software on the Iphone. I thought it was happening because I was using a window based computer to do the updates, this time I used my Macbook Pro. Please somebody help

    ljm17 wrote:
    ...This keeps happening, everytime I do this type of update, I...
    Then you should know what you need to do... If you don't remember...
    See Here  >  http://support.apple.com/kb/HT1808

  • Problem installating Snow Leopard on old Macbook Pro with Intel Core 2 Duo. After creating partition on internal hard disk (Extended Journaled), installation starts but stops at half of the progress bar. Screen asking Restart appears.

    Hello:
    I have tried installing Snow Leopard via the installation disc on a Macbook Pro (2007) with an Intel Core 2 Duo, but I the installation has failed more than 5 times.
    I have first formatted and partitioned the internal hard disk with Mac Os Extended Journal format.
    Once the installation starts, it starts without a problem unti lthe progress bar gest until half completed then a screen asking for a Computer Restart shows up.
    It asks to press the power button for some time until it the computer shuts down and then, press again to turn it on.
    Once turned on, the installation disc gets readed, the installation screen appears again and asks again to start the whole installation process form the beginning.

    Then you have a Hardware Problem.
    Your system is Crashing part way through the install and Re-Booting because of the crash.
    Could be the drive itself or it could be some other hardware part in your system. Like the RAM.
    To check if it is the internal drive connect an External drive to the system by USB and do the install on that external. If the install completes then it more then likely the drive is bad. If it crashes again then it is more then likely some other piece of hardware in your system.

  • After updating to the latest version of Firefox on my Mac there is no progress bar for the page load. I really miss this feature and can't seem to find a way to obtain it.

    The page load progress bar that was on the lower right of the window is no longer there. After updating to the latest version of Firefox on my Mac there is no progress bar for the page load. I really miss this feature and can't seem to find a way to obtain it. The tab has a circular progress wheel but this is useless for determining a stuck or slow loading page.
    PLEASE NOTE: I am typing this in from a Windows based work computer but am asking about my Apple MacBook Pro that i use at home.

    Firefox 4 saves the previous session automatically, so there is no longer need for the dialog asking if you want to save the current session.<br />
    You can use "Firefox > History > Restore Previous Session" to get the previous session at any time.<br />
    There is also a "Restore Previous Session" button on the default <b>about:home</b> Home page.<br />
    Another possibility is to use:
    * [http://kb.mozillazine.org/Menu_differences Firefox (Tools) > Options] > General > Startup: "When Firefox Starts": "Show my windows and tabs from last time"

  • When I try to empty trash, progress bar stops, and I have to reset finder

    This has been happening for about a week or so. Regardless of what the files are, I am unable to delete them. Whether I do a standard empty trash, or a secure empty trash, I end up with the same progress bar that stops during the process. I've let it sit for several minutes and over an hour, leaving me the only option of doing a force restart of finder.
    Currently I am unable to delete anything, putting a serious hold on my workflow.
    It appears that many people are having all kinds of trash issues with Snow Leopard. I'm assuming Apple is working on a fix, but I'm not sure when that's coming out. Until then, if there is some kind of work-around, I'd love to know about it.
    Any guesstimates on when Apple will release the next OS update?
    Cheers.
    Ben

    Start with http://www.thexlab.com/faqs/trash.html Do note that AFAIK, there aren't any trash issues with Snow Leopard, just the normal handful of common issues, usually fixed by the steps in the linked article.

  • 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.

  • 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

  • Intel iMac - won't start - grey screen & progress bar

    I have a 2006 Intel iMac - 20" model, Intel Core Duo, 2GHz, 2GB RAM, 250GB HDD, etc.  It was one of the very earliest Intel iMacs.  Kept updated, running OS 10.6, etc.
    It has worked extremely well for over 5 years - apart from the Superdrive being temperamental sometimes - but has suddenly gone wrong.
    Last week the machine completely froze for no apparent reason.  I had to force a reboot.  This failed - grey screen and the grey spinning wheel (if that's what it's called), indefinitely.
    Forced reboot again and this time held down the shift key to go into safe boot mode.  This time it was successful, and I was able to get to the logon screen & log myself in.  I opened Disk Utility & attempted to do some diagnostics but the machine froze again.
    Looking around various other forum postings...I rebooted the machine in single user mode and was able to get to the command line to type 'fsck -fy' to attempt to fix disk problems.  This failed repeatedly, with an error message 'invalid node structure'.
    I tried to boot my machine from the OS X disc but my Superdrive refused to play ball - it would not read the disc (or any other disc for that matter, including a copy of DiskWarrior that I have).
    I have now got hold of an external DVD drive in the hope that this would show up as a boot device when I switch the machine on while holding the option key down.  No such luck - the drive powers up ok (power via USB) but I'm not given the option to boot from it - in fact that screen doesn't appear at all.
    All that happens now on powering up - regardless of what I do - is the grey apple symbol appears and a progress bar beneath it.  The progress bar gets stuck about 5% of the way along, and then after about 10 minutes it disappears and is replaced with the grey spinning wheel thingy.  And then it just gets stuck - nothing else happens.
    HELP!
    All my important data is backed up on an external drive via Time Machine, so that should be safe, but I'm desperate to get the machine running again.
    One thing that occurred to me is that I've had a program called ReFit installed on the machine which allowed me to run the machine as dual boot etc. (and I do have a couple of other small partitions on the drive, not currently used) but the ReFit welcome screen stopped appearing a couple of weeks ago for some reason.  I'm wondering if this has somehow messed things up...?
    Grateful for any suggestions...
    Thanks,
    Alan.

    For the drive, you should be OK with any SATA 2 at 3 MB/s transfer speed. You could also use a SATA 1, no jumpers needed. (Not SATA 3 - can't be jumpered down.) The early 2006 Intels were 1.5 MB/s -- at least the drives were, so I'm assuming the SATA controller on the logic board was also. Might just be SATA 2 hadn't yet been introduced and can run the faster SATA 3 without jumpers. My guess is not. You should be able to set jumpers on the drive for backwards compatibility. You'll have to contact the drive manufacturer or go to their website for that info.
    http://www.everymac.com/systems/apple/imac/stats/imac-core-2-duo-2.16-20-inch-sp ecs.html
    As for the superdrive, I'd contact the manufacturer to check on compatibility.
    Glad I'm able to help. BTW, in case you haven't noticed, maybe you want to have a look here.

  • Progress bar on start up doesn't finish

    When I log onto my MacBook Pro after I enter my password a progress bar appears which starts to move across but only goes about 20% of the way before the desktop appears. I have heard that there has been a problem with automatic updates which don't fully install and this could be a symptom of that. Unfortunately I now get a problem where the Desktop seems to freeze and I can't select items with the trackpad. I'm not sure if the two are linked or just a coincidence.

    That is normal. If you get to the Desktop and all is working you don't have a problem. But if you do have a problem, then you need to do this:
    Try these in order testing your system after each to see if it's back to normal:
    1. a. Resetting your Mac's PRAM and NVRAM
        b. Intel-based Macs: Resetting the System Management Controller (SMC)
    2. Restart the computer in Safe Mode, then restart again, normally. If this doesn't help, then:
         Boot to the Recovery HD: Restart the computer and after the chime press and hold down the
         COMMAND and R keys until the Utilities menu screen appears. Alternatively, restart the
         computer and after the chime press and hold down the OPTION key until the boot manager
         screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    3. Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the Utilities menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu. Select Restart from the Apple menu.
    4. Reinstall Yosemite: Reboot from the Recovery HD. Select Reinstall OS X from the Utilities menu, and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible
                because it is three times faster than wireless.
    5. Reinstall Yosemite from Scratch:
    Be sure you backup your files to an external drive or second internal drive because the following procedure will remove everything from the hard drive.
    How to Clean Install OS X Yosemite
    Note: You will need an active Internet connection. I suggest using Ethernet if possible
                because it is three times faster than wireless.

Maybe you are looking for