Progress bar with Cancel button

Hi Gurus,
How to implement the Progressing bar with Cancel btn using the ScriptUI?, is it possible in script UI ?
Thanks in advance.
Regards,
Imagine

what i said is that you need to hava a reference to your thread ine the class that handle the progressBar.
and in your Thread class you create a method like setCanceled(boolean b)...
public MyThread extends Thread{
   private boolean canceled = false;
   public void setCanceled(boolean b){
      canceled = b;
   public void run(){
      while(!canceled){
        //do your stuff

Similar Messages

  • My iPhone 4s is not switching on, I connected it to itunes thru my Windows 7 laptop and it says phone needs to be restored. I clicked okay and it started the process however the progress bar with the apple logo is on the screen, progressbar do not start

    My iPhone 4s is not switching on, I connected it to itunes thru my Windows 7 laptop and it says phone needs to be restored. I clicked okay and it started the process however the progress bar with the apple logo is on the screen, progress in the bar did not start yet after 5 hours. Some one please hep me.

    I did put it in DFU mode but its still not working, although everytime it shows your iphone needs to be restored. Kindly help.

  • How to use a progress bar with java mail?

    Hi, i'm new here.
    I want if someone can recommend me how to show a progress bar with java mail.
    Because, i send a message but the screen freeze, and the progress bar never appear, after the send progress finish.
    Thanks

    So why would the code we post be any different than the code in the tutorial? Why do you think our code would be easier to understand? The tutorial contains explanations about the code.
    Did you download the code and execute it? Did it work? Then customize the code to suit your situation. We can't give you the code because we don't know exactly what you are attempting to do. We don't know how you have changed to demo code so that it no longer works. Its up to you to compare your code with the demo code to see what the difference is.

  • JavaFX progress bar with glow effect.

    I am hoping someone can help me with this issue. I recently followed James Clarke example of a progress bar with glow effect and it helped with developing a progress bar for an application I was working on. But now, with the JavaFX sdk 1.2 update, the application does not fully work anymore. The progressbar.fx code is posted below:
    ProgressBar.fx code:
    import java.lang.Math;
    import java.lang.Object;
    import javafx.animation.Interpolator;
    import javafx.animation.Timeline;
    import javafx.scene.CustomNode;
    import javafx.scene.effect.GaussianBlur;
    import javafx.scene.Group;
    import javafx.scene.Node;
    import javafx.scene.paint.Color;
    import javafx.scene.paint.Paint;
    import javafx.scene.Scene;
    import javafx.scene.shape.Ellipse;
    import javafx.scene.shape.Rectangle;
    import javafx.scene.text.Font;
    import javafx.scene.text.Text;
    import javafx.scene.text.TextOrigin;
    import javafx.stage.Stage;
    import javafx.scene.layout.Resizable;
    public class ProgressBar extends CustomNode, Resizable{
    public var min: Number;
    public var max: Number = 100.0;
    public var value: Number;
    public var background: Paint = Color.rgb(118,149,178);
    public var foreground: Paint = Color.rgb(216,219,225);
    public var font = bind Font{name: "Courier Bold Italic" size: height - borderWidth * 8};
    public var arcWidth: Number = 20;
    public var arcHeight: Number = 50;
    public var borderStroke: Color = Color.BLACK;
    public var borderWidth: Number = 1;
    public var fontPaint: Paint = Color.LIGHTGRAY;
    public var showPercentage = true;
    var progressText: Text;
    var backgroundText: Text;
    var progessBar: Rectangle;
    var range = bind Math.abs(max - min);
    var percentComplete: Number = bind if(max != 0) { (
    value - min) / max
    } // if
    else {0.0;} // else;
    var currentX = bind percentComplete * width;
    var blurX: Number = 30;
    var progressString: String = bind "%%{%.0f (percentComplete*100)}";
    var progressValue = bind "{%.2f value}";
    var progressHeight = bind height - borderWidth * 4;
    var blurAnim = Timeline {
    repeatCount: Timeline.INDEFINITE
    autoReverse: true
    keyFrames: [
    at(0s) { blurX => 0.0 }
    at(2s) { blurX =>
    currentX - progressHeight / 2 tween Interpolator.EASEBOTH }
    var playing = bind visible on replace{
    if(playing) {
    blurAnim.play();
    }else {
    blurAnim.stop();
    public override function create(): Node {
    return Group {
    content: [
    Rectangle { //background
    width: bind width
    height: bind height
    fill: bind background
    stroke: bind borderStroke
    strokeWidth: bind borderWidth
    arcWidth: bind arcWidth
    arcHeight: bind arcHeight
    cache: true
    backgroundText = Text { // Text over Background
    layoutX: bind (width - backgroundText.layoutBounds.width) / 2
    layoutY: bind (height - backgroundText.layoutBounds.height) / 2
    textOrigin: TextOrigin.TOP
    font: bind font
    fill: bind foreground
    content: bind if(showPercentage) progressString else progressValue
    cache: true
    Group {
    content: [
    progessBar = Rectangle { // Progress
    layoutX: bind borderWidth
    layoutY: bind borderWidth * 2
    width: bind currentX
    height: bind progressHeight
    fill: bind foreground
    arcWidth: bind arcWidth
    arcHeight: bind arcHeight
    Ellipse {
    centerX: bind blurX
    centerY: bind height / 2
    radiusX: bind progressHeight
    radiusY: bind progressHeight / 2
    fill: Color.rgb(255,255,255,.7)
    effect: GaussianBlur{ radius: 30
    Text { // Text Over Progress Bar, this has to be in progressBar coordinate space
    x: bind (width - backgroundText.layoutBounds.width) / 2
    y: bind (height - backgroundText.layoutBounds.height) / 2
    textOrigin: TextOrigin.TOP
    font: bind font
    fill: bind background
    content: bind if(showPercentage) progressString else progressValue
    clip: bind progessBar
    }, // Text
    ] // 2nd content
    } // 2nd Group
    ] // 1st content
    }; // 1st Group
    } // public override function create(): Node
    } // public abstract class ProgressBar extends CustomNode, Resizeable
    function run(args:String[]):Void {
    var stage: Stage = Stage {
         title: "Progress Bar"
    scene: Scene {
    width: 925
    height: 60
    content: ProgressBar {
         layoutX: 10
    layoutY: 10
    width: 890
    height: 35
    value: 80
    } // content: ProgressBar
    } // scene: Scene
    } // var stage: Stage = Stage
    } // function run(args:String[]):Void
    I use RESTful ws to get the progress of the billing run, which is the loadProgressdata() method in the main.fx, and everything was working fine until we did the javafx sdk 1.2 update. With the update in place, I recompiled the project and found that "Resizable" in
    the "public class ProgressBar extends CustomNode, Resizable" was throwing an error when the project was recompiled. I made some changes(mainly adding variables for height and width) but now when the program runs, the backing rectangle appears along with the
    percentage of billing progress, but the progress part(2nd rectangle) does not appear with the glow effect. I have read about using "getPrefWidth()" and "getPrefHeight()" methods, but not really sure how I would use them. I can't make the public class ProgressBar extends CustomNode, Resizable abstract as I need to instantiate in the Main.fx.
    Can anyone shed some light on what might need to be done to get this running correctly again. I don't need anyone the give me the exact code, but just to point me in the correct direction.

    Can you post your code again between "{ code} ... {code }" tags ? Some symbols are missing if copy/pasted.
    That said, your preferred width and height, simply return the width and height of your component. What I discovered recently is using LayoutInfo on controls to set the preferred width and height. These are the dimensions the surrounding container (VBox, HBox, Flow, ....) will use to arrange size and position of the enclosed components. So maybe you won't need Resizable any more. Simply fill in the layoutInfo property.
    Edited by: Java.Artisan on Jun 26, 2009 11:25 AM
    Edited by: Java.Artisan on Jun 26, 2009 11:26 AM

  • Horizontal progress bar with interpolat​e color

    Looking for a control "horizontal progress bar" with interpolate color and markers like control "meter"

    If I get this right - you are looking for a progress bar that changes colour as the number changes. You can set the colour of the progress bar using property nodes. I have included a VI here that I used for testing this. This VI changes the colour from green to red as the progress bar advances. Colours are stored as 3 bytes: Red, Green and Blue.
    I hope that this helps.
    Rob
    Attachments:
    Changing_Progress_Bar.vi ‏27 KB

  • Processing Page with cancel button.

    Hi,
    I have implement Processing Page but client wants to have cancel button to cancel the process.
    Can anyone give suggestions how to implement this?
    SC

    My requirement is that i have a custom base page with submit button. When user clicks on submit button it would start long running process
    And I should show a dialog page with clock saying process in progress message and a cancel button. User should be able to stop the process by clicking cancel button and back to base page. OAF gives the processing page that i want but without cancel button.
    I try to add cancel button on the processing page programmatically but while it is processing and when i click on cancel button i cannot capture the event.
    how to add cancel button on it and capture event? Is this correct approach?
    Can any body could suggest the best approach and solution?
    Thanks
    SC

  • TS3694 hi i recently updated into ios 7.0.4 now i want to fully restore my ipad to resell but when i restore it it got stuck with apple logo and progress bar with 45% completed as firware file is downloaded using ipad 4 wifi itunes 11.3.8

    hi i rescently updated my ipad 4 in ios 7.0.4 and for resell purpose i want to restore my ipad via itunes but it got stuck at apple logo and progress bar of 45% completed i tried it 50 times but it stuck on that exact point for hours i cant able to restore it and had no errors it just like freezes at one point i also uses dfu mode but got stuck at same problem using windows 7 32 bits itunes 11.3.8 ipad 4 wifi please help

    My iPhone 5 wouldn't start after I turned it off a few minutes after writing this. It went into recovery mode and I had no choice but to connect to iTunes on PC and restore.
    I restored to factory setting first, just to validate my phone was okay. For a second consecutive iOS update, the  iPhone 5 did not update smoothly while connected to PC and iTunes - I had to retry two times before the progress bar for the update showed. (The exact same problem with the restart occured when I updated to 7.0.4.)
    The good news is that I was ultimately able to restore the iPhone 5 to factory settings while running iOS 7.0.6. I did have a backup from about a month ago lying around and was able to successfully restore with that as well, so the damage done is almost negligible since I had my contacts, notes, mail, etc. backed up to iCloud.
    Once I completed both restores, the sync with iTunes worked fine.

  • Why is the left hand window and bar with the buttons for TOC/Search/Glossary not displaying in one client location?

    Greetings all:
    I have more years of experience with RoboHelp than I want to admit, but I have never run into this before. I have a published RoboHelp 9 project for an overseas client that displays exactly as it should when the published version is viewed by myself or another RoboHelp developer (not located where I am). However; the users at 1 of 2 two client sites do not see the left hand TOC window or the bar above the project with the buttons (the other site does see it). The users at both sites are using Internet Explorer 9, and I have been told there is no difference in their security set-up. I suspect that at the site where it is not displaying there is a security setting that is throwing it off, but I am not sure what to have them look for. Anyone have any ideas?
    W. Keith

    Do they not simply see the bar or is it empty? In the first situation, it seems they are opening the topic directly instead of via the start file.
    What is the URL the users are using on both the locations? And do the users have a hyperlink 'Show' at the top of the topics?
    Kind regards,
    Willam

  • Black screen/progress bar with Yosemite startup

    Since installing Yosemite on my relatively new imac, when I boot up i get a black screen with the Apple logo and a progress bar, which takes about 90 seconds to load. I've tried disc first aid, verify/repair permissions etc , done a new install from my backup disc but it still persists. is this now the way of the yosemite world?
    Thanks
    Bruce

    Try booting into the Safe Mode using your normal account.  Disconnect all peripherals except those needed for the test. Shut down the computer and then power it back up after waiting 10 seconds. Immediately after hearing the startup chime, hold down the shift key and continue to hold it until the gray Apple icon and a progress bar appear and again when you log in. The boot up is significantly slower than normal. This will reset some caches, forces a directory check, and disables all startup and login items, among other things. When you reboot normally, the initial reboot may be slower than normal. If the system operates normally, there may be 3rd party applications which are causing a problem. Try deleting/disabling the third party applications after a restart by using the application un-installer. For each disable/delete, you will need to restart if you don’t do them all at once.
    Safe Mode - About
    Safe Mode - Yosemite

  • Error with "Open/Create/Replace File" function with cancel button

    I've attached a very simple VI that embodies what I want to do with my Open File function. I simply want to stop the rest of my program (theoretically encased in the Case Structure) from running if the user deigns not to specify a file location.
    However, if the Cancel button is clicked an error is produced before the rest of the program runs. If you ignore the error and continue, the "cancelled' variable is appropriately made true and the Case Structure runs properly. I simply want to remove the error message LabView gives me.
    Any ideas on why or how?
    Solved!
    Go to Solution.
    Attachments:
    Open file test.vi ‏34 KB

    The cancel button gives you error code 43 (if I remember correctly). After your file vi's, use the general error handler (GEH) to clear this error (and no other errors). Use
    [exception action]=Cancle Error on Match
    [exception code]=43
    type of dialog=no dialog
    Felix
    www.aescusoft.de
    My latest community nugget on producer/consumer design
    My current blog: A journey through uml

  • [SOLVED] No icon or progress bar with notify-osd-customizable

    Hello,
    I just reinstalled my system; I use a script to know my brightness and audio volume but I can't get it working anymore.
    With this
    notify-send 'Hello world!' -i dialog-information
    I only get the text. If I try this to have a progress bar
    notify-send 'Hello world!' -i dialog-information -h int:value:50
    I just get a notification with 1px height.
    I installed notify-osd-icons to have more icons, but it didn't help.
    The arguements have changed?
    Last edited by Dreamkey (2013-02-13 13:02:29)

    Ok, I'm not sure if it's because of that, but I installed human-icon-theme and after a reboot, it worked.

  • InputVerifer unable to exit with cancel button.

    Just playing with the verifier and notice that I am unable to "cancel" when I failed the validation. I understand that I can not conintue to next field, but if I failed but how come I can't cancel out of the form? I could exit if use the [x] on the upper right side. which uses the WindowAdapter.
    Any idea on how I can permit my cancel button to work under this situation also?
    Here is my sample code. The basic code I got it from http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/InputVerifier.html
    modified for my own test.
    package verifier;
    import java.awt.*;
    import java.util.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class VerifierTest extends JFrame {
        public VerifierTest() {
            JTextField tf1 = new JTextField ();
            getContentPane().add (tf1, BorderLayout.NORTH);
            tf1.setInputVerifier(new PassVerifier());
            JTextField tf2 = new JTextField ("next field");
            getContentPane().add (tf2, BorderLayout.CENTER);
              JButton buttonCancel = new JButton("cancel");
              buttonCancel.addActionListener(new CancelListener());
              getContentPane().add(buttonCancel,BorderLayout.SOUTH);     
            WindowListener l = new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                     System.out.println(" win closing");
                    dispose();
            addWindowListener(l);
        class PassVerifier extends InputVerifier {
            public boolean verify(JComponent input) {
                JTextField tf = (JTextField) input;
                  if(tf.getText().equals(""))
                    input.setInputVerifier(null);
                    JOptionPane.showMessageDialog(null,"Error, textfield empty");
                    input.setInputVerifier(this);
                    return false;
                  return true;
         protected class CancelListener implements ActionListener{
              public void actionPerformed(ActionEvent event) {
                   System.out.println(" cacnelListener Action");
                   dispose(); // Or System.exit(0) if you don't want to do
                   // something on close.
        public static void main(String[] args) {
            JFrame f = new VerifierTest();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.pack();
            f.setVisible(true);
    }

    thank you both. I should of use search forums with the key word. I was getting too much return with jtextfield inputverifier.
    oh well....

  • Scale progress bar with Event.RESIZE

    Hi all,
    I am trying to create a preloader bar that goes across the whole stage. The code below works fine, except that I would also like to be able to resize the stage and have the preloader bar recognize this and change it's scaleX to accomodate the larger or smaller browser size. Does this make sense? I'm having trouble with the equation to adjust the preloader bar scaleX within the "onResizeStageLoad" function.
    function PL_LOADING(event:ProgressEvent):void {
    var pcent:Number=event.bytesLoaded/event.bytesTotal*100;
    //Stretch the bar
    lbar.scaleX=pcent/100;
    if(pcent >=100){
    this.gotoAndStop(2);
    stage.removeEventListener(Event.RESIZE, onResizeStageLoad);
    stage.addEventListener(Event.RESIZE, onResizeStageLoad);
    function onResizeStageLoad(evt:Event):void{
    What goes in here?
    Thanks!

    Just to close this out. You need to submit the form from within the onComplete javascript. The prior version of the progress bar 'automatically' called submitFomr() when the progress bar was 100%. That is no longer true. You must explicitly call the submitForm() javascript in onComplete. Don't know if this is a bug in the new version or not? I recommend that the submitForm() be made the default function for onComplete is none is specified in the component properties.

  • Progress Bar with Javascript

    Hi,
    I have a page that is used as a search
    page that uses sql "like" queries.As
    you know it takes an awfull lot of time
    to search through 30,000 records using
    a "like" statement,so i'd figured I create a nice
    javascript progress bar to be displayed until
    the results come up.Does anyone know how
    to do this?
    So when the search button is clicked then the
    progress bar/REGION should be display and
    when the results come up, the progress bar should
    be hidden.
    Any good suggestions?

    The way I did it is
    I added this javascript to the page header:
    <script language="JavaScript" type="text/javascript">
    <!--
    /*- id can be element or nd or name returns element node */
    function html_GetElement(nd){
         switch(typeof (nd)){
         case 'string':node = document.getElementById(nd);break;
              case 'object':node = nd;break;
    default:node = null;break;
         return node;
    function html_CascadeUpTill(START,TAG){
    var node = html_GetElement(START);
         if(node){
         var node = node.parentNode;
    while(node.nodeName != TAG){
         node = node.parentNode;
         return node;
    /*- hides given node */
    function html_HideElement(nd){
         var node = html_GetElement(nd);
         node.style.display = "none";
    return node
    /*- show given node */
    function html_ShowElement(nd){
         var node = html_GetElement(nd);
         node.style.display = "";
    return node
    /*- toggle node visibility */
    function html_ToggleElement(nd){
         var node = html_GetElement(nd);
         if(node.style.display == "none"){html_ShowElement(node)}
         else{html_HideElement(node)}
         return node
    var g_LastRowOpened = false;
    var g_LastDetailLabel = false;
    var g_ShowOnlyOne = false;
    function showdetail(t,i){
         var l_TR = html_CascadeUpTill(t,'TR');
         var l_ThisTable = html_CascadeUpTill(t,'TABLE');
         /* comment out following if statement if you don't care about only showing one at a time */
         if(html_GetElement('P1_MULTI_0').checked==false && g_LastRowOpened && g_LastRowOpened != l_TR){
              ShowHideDetailRow(g_LastDetailLabel,l_ThisTable,g_LastRowOpened,i); //hides last row shown and resets label
         ShowHideDetailRow(t,l_ThisTable,l_TR,i);     
         g_LastDetailLabel = t; // set the last show/hide_detail clicked
         g_LastRowOpened = l_TR; // set the last row clicked     
    function ShowHideDetailRow(pThis,pTable,pTR,pID){
         var l_NumCells = pTR.cells.length;     
         if(pTR.rowIndex == pTable.rows.length-1 || pTable.rows[pTR.rowIndex+1].className != "detail"){
              var myNewRow = pTable.insertRow(pTR.rowIndex+1);
              myNewRow.className = "detail";
              var myNewCell = myNewRow.insertCell(0);
              myNewCell.className = "t4data";
              myNewCell.colSpan=l_NumCells;
              myNewCell.appendChild(html_GetElement(pID));
              html_ShowElement(pID);
         }else{
              html_ToggleElement(pTable.rows[pTR.rowIndex+1]);
         SetDetailLabel(pThis);
    function SetDetailLabel(pThis){
         if(pThis.innerHTML == 'show_detail'){
              pThis.innerHTML = 'hide_detail'
         }else{
              pThis.innerHTML = 'show_detail'
    //-->
    </script>
    then made my button a URL target and added:
    javascript:html_ShowElement('AjaxLoading');doSubmit('SEARCH');
    and finally added this to my HTML's region source:
    <style>     #AjaxLoading{padding:5px;font-size:18px;width:200px;text-align:center;left:50%;top:50%;position:absolute;border:2px solid #666;background-color:#FFF;}
    </style>
    <div id="AjaxLoading" style="display:none;">..Loading..
    <img src="#WORKSPACE_IMAGES#processing3.gif" /></div>
    I know its a bit amatuer but it seems to be working fine.
    The only problem that I've got is that it doesnt work when hitting <Return> to do the search rather than clicking on the search button.
    rather than

  • Progress bar with install screen.

    Hi all,
    On my app I need a progress bar when I the app install some RMS records. Because of the app has near a milliom of records, this install is so longer, and I t's better show the progress of it with an bar :).
    How it's possible do it?
    Kind regards.

    In such case i recomend writing your own LoadingCanvas or something like that (You draw a kind of rectangle which size is connected to current progress). Animating this canvas while conducting another task is a different issue. In my soft I needed to view a progress bar while downloading images and so on from net. I achived it by running one separete thread for the connection and lunching a timerTask for the canvas redraw events. In my case it worked fine almost on every device but ned Nokia E series phones had some problems in memory management of 2 paralel task so i had to remove this form my app becouse it caused instability of application.
    Regards
    mchmiel

Maybe you are looking for

  • Copy file from directory to another directory

    I need to copy a file from a directory to another directory, but that file is longer than 2M. I put the data into a array of bytes and then i passed to a destination directory. Now i'm using a BufferedOutputStream but, as i have a file whith 2M, and

  • Unable to upload photos to any hosting site since upgrading to Tiger....

    ....while using Safari this is the error message that I get when trying to upload photos to any site (http://www.PictureTrail.com or any other site like it): Safari can't open the page. Safari can't open the page "http://www.scubadivingsingles.com/me

  • Audio Pans Grayed Out

    Hey everyone, My audio pans are grayed out, not sure why. I never encountered this problem before and wondering if anyone has any suggestions on how to un-gray them. Thanks, Rob

  • What is a business package?

    What does the business package contain?

  • Admin password not accepted anymore - but it's correct

    Hi, i have a strange problem in Lion 10.7.5: My admin password is not accepted anymore in Lion. Whenever i'm asked to enter the Admin password, the window closes (therefore: no "wrong password" message or something else) but the process isn't continu