Disable gui buttons while excuting script

hi,
i have class that that calls script in one of methods
    synchronized(this){
         Process p = Runtime.getRuntime().exec("cmd /c start " + script.getCanonicalPath());
         p.waitFor();
    }I'm writting a swing gui above this class..
This method is quite time consuming, so i use swingworker for this(code above is called from doInBackground() method)
While i'm calling method above i would like to have buttons on my form disabled,
so i used this code:
      okButton.setEnabled(false);
      cancelButton.setEnabled(false);
      InitSwingWorker sw = new InitSwingWorker();
      sw.execute();As swing worker finisher buttons are supposed to be enabled again, so i enable them in the done() method of swing worker
public void done(){
            okButton.setEnabled(true);
            cancelButton.setEnabled(true);
        }And my problem is this:
buttons disables (that's fine), but they don't stay disabled until executing of script is done. They are enabled right away, i can see that they were disabled for few milis maybe,
but that's it.
thanks for any help with this :)

When you run a "start" command in the command processor it starts a background Windows process and returns immediately. It will probably work if you remove the "start".

Similar Messages

  • How to disable a button using Java Script in Apex

    Hi All,
    I was trying to disable a button when the value of a select list item in the same page is equal to zero. Following are the steps which I did.
    1) Created a new button template as <table class="t9StandardButton" id="#BUTTON_ID#" cellspacing="0" cellpadding="0" border="0" summary="">
    2) Changed the existing button template to the newly created button template.
    3) Added onchange="javascript:fdisplay(this);" to form element value of select list
    4) Added the following java script in the page header
    <script type="text/javascript">
    function fdisplay(some) {
    if (some.value==0){
    html_GetElement ('#BUTTON_ID#').disabled = true;
    else
    html_GetElement ('#BUTTON_ID#').disabled = false;
    </script>
    But the script doesn't work. Is there anything I am missing here. Please advice.
    Thanks,
    Vikas

    Vikas:
    In the 'Button Attributes' field of the button enter 'id='thisButton'.
    Modify the button template to include the substitution string #BUTTON_ATTRIBUTES# . This should be put in the anchor tag in the template defintion.
    Modify your Javascript to reference the above id as
    html_GetElement ('thisButton').disabled = true;
    ....Varad

  • OK Codes of GUI buttons while GUI recording.

    Hi all,
    I am facing a problem.. While BDC recording of any T-Code OK- Codes of the GUI (PF status) buttons like Cancel, Back and Up are not captured..
    Suppose after recording is done and we run that BDC recording and at any point of time we want to press 'CANCEL' and come out of screen it is not cancelled and goes further to the next screen..
    Please Help.
    Thanks and Regards,

    hi,
    No need to capture gui button function code..
    In SAP 'bend ' function code is used for come out the bdc recording at any step provided by .
    regards
    Gaurav

  • Disable Media button while working

    I think this maybe a feature request more than anything, but perhaps someone has a work around!
    I have a comp with 200+ layers, around 40 or so have movs/mp4 etc and finding that everything is grinding to a halt when working. I don't need to see these vids while setting some stuff up and think a simple Disable Footage/UnPreview Media (or similar) button along the top of the timeline, next to Shy Layers for example, would be extremely useful. I wouldn't what them switched off entirely - perhaps just filled with a solid colour which could be set in Preferences.
    Turning on and off manually is prone to error, I've tried giving the media content their own label colours and selecting that way but they are already grouped. Anyone else found this an issue and a quick solution?

    WOW - look at that! Thanks Mylenium - I wish I'd asked two weeks ago (or, rather, 10 years ago)!! Adobe should buy this and build it in

  • Disable Shutdown Button while using Terminal Services

    When I remote desktop into the server remotely, the shutdown button shut's down the server.  Granted I have the reason for shutdown turned on, so some less skillful admin's have to fill in the reason and click okay before they really shutdown the server... but
    Is it possible to replace the shutdown button with a Log Off button for remote sessions or disable it all together?
    Seems like it could be a huge problem if I (or someone logged in as Admin) shutdown the server that's 4 hours away.

    Absolutely, we have had this since 2000 (though we do tend to change the name in each new policy editor) :-).
    In 2008 you need to use group policy and set the user config -> admin templates -> start menu and taskbar -> remove and prevent access to the shutdown, restart, sleep and hibernate comands = enabled
    You probably want to apply this to a machine OU with loopback policy so it only applies to terminal severs.
    You may also want to filter it to apply only to the remote desktop users group (this way it only applies when you logged in remotely).
    if you still need to shutdwon the remote machine when remotely connected then use ctrl-alt-end to bring up the remote SAS and the shutdown button is there in the bottom right hand corner.
    Alex

  • Can we disable cancel button in the File download

    Hi Experts,
    Working in jdev 11.1.1.30.
    Can we disable cancel button while trying to download file. and by default file will open with out click on open file, is thes possible?
    Edited by: user5802014 on Aug 17, 2010 9:15 AM

    Hi Kamal,
    how to disable “Cancel and keep workitem in Inbox” button in the user decision.
    As far as i know this is not possible. Just recollected reading this [old thread.|http://mailman.mit.edu/pipermail/sap-wug/2004-September/014240.html]
    then the work item is regenerated for him alone.
    Again this is a standard behaviour, as soon as the workitem is executed by one of the responsible agents it is reserved for that person so that no one can perform any action on it unless the first person replaces it intentionally. Yes, it would have been a better option to have it replaced automatically on pressing "Cancel and keep the workitem in inbox" but this is the way the design is. It is the responsibility of the agent to replace it manually (using "Replace" button) after performing any action on the workitem including pressing "Cancel" button. You may need to take care of this in the user training.
    Additionally you can also schedule a report (may be once a day in the midnight) which can check for the reserved workitems and replace all of them using "SAP_WAPI_PUT_BACK_WORKITEM". This would make sure that the workitems are replaced to all users even if the user has accidentally forgot to replace the workitem. Again in this case the user cannot "Reserve" a workitem even if he/she wants to (as your scheduled report would replace it in the midnight).
    Thanks,
    Prasath N
    Edited by: Prasath Natesan on Dec 26, 2007 5:56 PM
    changed "Replace manually" button to "Replace" button

  • Captivate 7 - Can you disable a button in Properties?

    Hi,
    I have a screen with popups and want to disable the navigation buttons until each popup is closed. I am disabling the buttons in the scripts that open the popups, which is fine. However, I am at showing "dummy" navigation buttons on top of the real buttons that look greyed out. These don't do anything but I can't find a way of disabling them so you can't tab to them without having to write a script for the page to disable them.
    Is there a way to disable buttons without writing a script for page enter?
    Or, better yet, is there a way to change the look of a button between enabled and disabled (I'm using a lighter font color for my disabled buttons)?
    Thanks for any suggestions.

    I've just discovered that just disabling the buttons will not disable the tabbing. You don't see the tabbing, but nonetheless these disabled buttons are included in the tabbing.
    So... is there any way to exclude buttons from the tabbing order? The only thing I can think of is to reproduce the buttons using a shape ... but I don't know whether I'd be able to get them looking exactly the same unless I use images instead.
    Or, is there a way to set the focus so the tabbing starts at a specific object? For example, if I have a popup displayed, I want the focus on the Close button so they don't have to tab around all the other buttons before it gets to the Close button.

  • 6210 Navigator - disabling camera button?

    My new 6210 is driving me nuts.
    Even when the keypad is locked the camera button (on the botton right hand side) is active.
    This means that just about every time I take it out of my pocket or bag it is in camera mode.
    Is there a way to disable this button while the phone is locked and in standby mode?

    make sure you don't have your cam app running in the background. you can check that by pressing the c button for a few seconds it will display all running apps on your system. make sure you do not carry your phone with magnets near by, metal and such as this also may affect your phones performance.
    You know what I love about you the most, the fact that you are not me ! In love with technology and all that it can offer. Join me in discovery....

  • Deactivati​ng On/off Button while in Screen-Loc​k

    Hi,
    Is it possible to deactivate the On/Off Button while the device is screen locked?
    A User have a problem that he puts his Blackberry in his pockets and it could be that the on/off Button gets accidentally pushed for some seconds and the Blackberry turns itself off.
    Now he wants to disable the button while in screen lock. Is it possible?
    Many thanks

    it is possible when using a holster or a pocket with a sleeper magnet in it
    Click here to Backup the data on your BlackBerry Device! It's important, and FREE!
    Click "Accept as Solution" if your problem is solved. To give thanks, click thumbs up
    Click to search the Knowledge Base at BTSC and click to Read The Fabulous Manuals
    BESAdmin's, please make a signature with your BES environment info.
    SIM Free BlackBerry Unlocking FAQ
    Follow me on Twitter @knottyrope
    Want to thank me? Buy my KnottyRope App here
    BES 12 and BES 5.0.4 with Exchange 2010 and SQL 2012 Hyper V

  • Disable checkbox lists while clicking Radio button

    Hi ,
    I have a checkbox list come from LOV based on a select from database table.
    I have added a Radiobutton only (not redirect not submit since I have to restrict the option as this is based on requirement).Now I want to disable the checkbox while I am clicking the radio button .
    Is it any way possible .
    Thanks in advance .
    Cheers,
    Debashis.

    ok, I create two radio buttons (Enable and Disable)(P8_RADIO). I created a LOV of users with checkboxes (P8_CHECK). When I click on disable all the checkboxes are disabled and enabled when I click on enable.
    First add this to your radio
    P8_RADIO's HTML Form Element Attributes
    onclick="disable(this)"
    Then, add this to the page HTML Header
    <script language="JavaScript" type="text/javascript">
    <!--
    function disable(pThis)
    var trigger = document.wwv_flow.p_v02.value ;
    var rads = document.wwv_flow.p_v02 ;
    if (pThis.value == 'ENABLE')
    for(var i=0; i<rads.length;i++ )
    { document.wwv_flow.p_v02[i].disabled = false; }
    } //end of if
    else
    for(var i=0; i<rads.length;i++ )
    { document.wwv_flow.p_v02[i].disabled = true; }
    } //end of else
    } //end of disable funtion
    //-->
    </script>
    **note**p_v02 is the name of the checkboxes.
    Hopefully this will help you and i explained it better than I did last time

  • How to disable the select options button, while audio is playing in the question template in captivate 8?

    How to disable the select options button, while audio is playing in the question template in captivate 8?

    Apologies for late reply.
    I mean "On Question screens audio keeps on playing even after we have selected an option or options depending on the question type and clicked Submit. How do we stop the audio on selecting an option?"

  • Disable button while generating a Report

    In my application, I have a JSP page with a button. On clicking this, a Report(PDF) is generated and response comes back as attachment.
    The requirement is to disable the button till the report is generated and enable it back once the response comes back.
    Can somebody help me?

    stevejluke wrote:
    Can you expand on this SoulTech? When you download a PDF one of two things happens (to my knowledge): Either the PDF gets displayed in the same window as the form or it gets opened in a new window. If it opens in the same window then the form will no longer be visible, so there would be no need to re-activate the button. If it opens in a new window, the button is not re-enabled on the form. At least not in IE or Firefox. What conditions make it so the page gets reloaded?Ahh, you're right. Well I'd make 2 JSP's then I suppose. Anything to avoid AJAX. So the first JSP page has the "Click here to download" and the second page has the "Downloading..." message (like many download pages on the web).

  • Java GUI for a shell script

    I have a file with passwd format.I made a script for this file that is working as I wanted it to work.I have a list of options and each time I give an option,the script is doing something(for example,if I press "b" it makes something and if I press "a" it makes something else).All the results are an output from the file.
    My question is how can I create a GUI in java for this script.For example if I want the script to do what it would do if I pressed the "a" button on my keyboard,but not by pressing "a",but by choosing from a drop down list or some other graphical feature(by ticking a check box,clicking a button etc).Can I do this with java?
    Lazaros

    Hi,
    I understand you can create a Java Swing gui for a bash shell script which takes both complex input and writes output to the stdout & files, to be specific. Is that correct?
    If yes, could you give a simple example. Say for the following shell script.
    #!/bin/sh
    printf "Enter input\n"
    i=0
    while [ $i -ne 1 ]; do
    read $inputVar
    if [  "$inputVar" == "y" ]; then
    printf "You typed yes\n"
    i=1
    elif [  "$inputVar" == "y"  ]; then
    printf "you typed no\n"
    i=1
    else
    printf "Enter a valid character\n"
    i=0
    fi
    done
    Could you also point to some URL's which might help? Googling for "Java Gui for shell script" returns this as the first page, others dont really help. Googling "GUI for shell script" returns all other gui toolkits for xes but thats not what I want. I want a cross platform (nixes, Win*, MacOS* ) gui for a shell script ( which I plan to run using cygwin etc).
    TIA
    Vinod

  • Disable delete button in Table Maintainance Generator

    Hello all,
      How to disable delete button in Table maintainance generator???

    Hi Maya,
    It is very interesting question. If you debug your table maintenance screen, the program of table maintenance screen will not have statically defined pf status. So you cannot exclude delete functionalities using the below statement.
    SET PF-STATUS <the GUI status> EXCLUDING 'DELE'.
    For viewing pf status SAP has programmed in dynamic manner using this FM VIEW_SET_PF_STATUS.
    Before calling above FM you need to exclude delete function. Follow the following step for achieving this
    Go to sm30. Put your table name and press on maintain push button. It will display table entries in maintenance screen.
    Go to system->status
    Click on program name.
    Go to your flow logic of you table maintenance screen number.
    It will have following code in flow logic
    PROCESS BEFORE OUTPUT.
    MODULE LISTE_INITIALISIEREN.
    LOOP AT EXTRACT WITH CONTROL
      TCTRL_ZMAINTAIN CURSOR NEXTLINE.
       MODULE LISTE_SHOW_LISTE.
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE LISTE_EXIT_COMMAND AT EXIT-COMMAND.
    MODULE LISTE_BEFORE_LOOP.
    LOOP AT EXTRACT.
       MODULE LISTE_INIT_WORKAREA.
       CHAIN.
        FIELD ZMAINTAIN-MATNR .
        FIELD ZMAINTAIN-KUNNR .
        FIELD ZMAINTAIN-LIFNR .
        MODULE SET_UPDATE_FLAG ON CHAIN-REQUEST.
       ENDCHAIN.
       FIELD VIM_MARKED MODULE LISTE_MARK_CHECKBOX.
       CHAIN.
        FIELD ZMAINTAIN-MATNR .
        MODULE LISTE_UPDATE_LISTE.
       ENDCHAIN.
    ENDLOOP.
    MODULE LISTE_AFTER_LOOP.
    Add new module in PBO for excluding delete function. ex  module set_pf.
    PROCESS BEFORE OUTPUT.
    ****here I added my own code for excluding delete function
    ****begin of addion
    module set_pf.
    ****end of addition
    MODULE LISTE_INITIALISIEREN.
    LOOP AT EXTRACT WITH CONTROL
      TCTRL_ZMAINTAIN CURSOR NEXTLINE.
       MODULE LISTE_SHOW_LISTE.
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE LISTE_EXIT_COMMAND AT EXIT-COMMAND.
    MODULE LISTE_BEFORE_LOOP.
    LOOP AT EXTRACT.
       MODULE LISTE_INIT_WORKAREA.
       CHAIN.
        FIELD ZMAINTAIN-MATNR .
        FIELD ZMAINTAIN-KUNNR .
        FIELD ZMAINTAIN-LIFNR .
        MODULE SET_UPDATE_FLAG ON CHAIN-REQUEST.
       ENDCHAIN.
       FIELD VIM_MARKED MODULE LISTE_MARK_CHECKBOX.
       CHAIN.
        FIELD ZMAINTAIN-MATNR .
        MODULE LISTE_UPDATE_LISTE.
       ENDCHAIN.
    ENDLOOP.
    MODULE LISTE_AFTER_LOOP.
    *****inclule one line of code for excluding delete fucion
    module set_pf output.
          MOVE 'DELE' TO excl_cua_funct-function. COLLECT excl_cua_funct.
    endmodule.
    Basically sap fetching status dynamically from program SAPLSVIM using FM VIEW_SET_PF_STATUS. Status name is EULG.
    Please donu2019t hardcode anything by using set pf status statment, you just add one line of code the PBO by creating new module.
    Let me know if you need any help .
    Cheers.
    Regards,
    Peranandam

  • Jsf and javascript to disable a button

    Hi
    is there a way to get the following code to disable the button called next
    when the button "btn" is clicked i call the javascript function myFunc but it does not disable the button called "Next"
    <html>
         <head>
              <title>Personal Info</title>
         </head>
         <body>
         <script type="text/javascript">
         function myFunc()
              document.personalForm.Next.disabled=true;    
         </script>
              <f:view>
                   <h:form id="personalForm">
                   <h:commandButton id="Next" value="Next" action="doSomething" />
                   <h:commandButton id="btn" value="button" immediate="true" onclick="myFunc()"  />
                   </h:form>
              </f:view>
         </body>
    </html>

    You should write Javascript according to the HTML source, not to the JSF code.
    View the generated HTML source and base your JS on that.

Maybe you are looking for

  • External Display Resolution Issue...

    I have a Mid-2012 MPB running Mavericks. Recently, I've tried connecting 2 different external display's to the MBP via an Apple Thunderbolt to VGA adaptor. I can't get the resolution of the connected displays to go above 800 x 600, and it looks awful

  • GL Account in Travel Expense infocube

    Please can someone help me. What is the infocube I can use to link it with the one of Travel Expense in order to get the GL Account? I need to obtain the GL Accounts for expenses that are affected. Thanks!!

  • About T500 - 2055T501

    I'm living in Romania, and I want to buy a laptop T500. And yesterday, I found one that has model 2055T501 with the configuration : Thinkpad T500 (PN 2055T501) - Intel Core 2 Duo Processor P8600 (2.40GHz 1066MHz 3MBL2) 25W - 15.4" WSXGA (1680x1050) -

  • Cannot use itunes or quicktime since buying quickTime Pro

    Itunes and Quicktime were working great. I purchased the key for QuickTime Pro and input it. Now, whenever I start itunes I get "please wait while windows configures itunes..." but it never configures. When I click "Quicktime Player" I get "Could not

  • Problems with CS3 and CS4 installations

    Hello, I have a problem when I install any product CS3 or CS4. When the program starts establishing, a window appears in the one that says " verifying the profile of the system " but the window being blocked always to 90 %. Does someone know the solu