Check button-click during for-statement

hi,
I have wrote an import-function that reads out a text-file.
I want that the user of my GUI is able to stop the import by pressing an abort-button.
unfortunately, java seems not to check for button clicks during a block of code is processed.
therefore I am looking for a work around.
thanks
gammloop

Java's Thread Tutorial
JavaWorld: Introduction to Java threads
IBM: Introduction to Java threads
Google: java+threads+tutorial

Similar Messages

  • SharePoint PPS 2013 Dashboard Designer error "Please check the data source for any unsaved changes and click on Test Data Source button"

    Hi,
    I am getting below error in SharePoint PPS 2013 Dashboard Designer. While create the Analysis Service by using "PROVIDER="MSOLAP";DATA SOURCE="http://testpivot2013:9090/Source%20Documents/TestSSource.xlsx"
    "An error occurred connecting to this data source. Please check the data source for any unsaved changes and click on Test Data Source button to confirm connection to the data source. "
    I have checked all the Sites and done all the steps also. But still getting the error.Its frustrating like anything. Everything is configured correctly but still getting this error.
    Thanks in advance.
    Poomani Sankaran

    Hi Poomani,
    Thanks for posting your issue,
    you must have to Install SQL Server 2012 ADOMD.Net  on your machine and find the browse the below mentioned URL to create SharePoint Dashboard with Analysis service step by step.
    http://www.c-sharpcorner.com/UploadFile/a9d961/create-an-analysis-service-data-source-connection-using-shar/
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • I'm trying to update my software to iTunes 10.5.2.  I click on the install button, click the Accept button, the software checks for updates, and then I am back at the original download screen.  I can't seem to get past this loop.  Any suggestions?

    I'm trying to update my software to iTunes 10.5.2.  I click on the install button, click the Accept button, the software checks for updates, and then I am back at the original download screen.  I can't seem to get past this loop.  Any suggestions?

    If I go through the setup that you suggested, won't I screw up the existing software on my system?
    No. The iTunes installer will first uninstall the existing version of iTunes and then put in the new one. (That's actually also what happens when you use Apple Software Update to install a new version ... it just doesn't show the uninstall phase like the iTunes64Setup.exe or iTunesSetup.exe does.)

  • Wait for a button click

    Hi,
    Here's the problem :
    my main class calls :
    LoginContext loginContext = new LoginContext("Main",
    new DialogCallbackHandler());
    I've made a DialogCallbackHandler class which opens a JFrame with 2 fields (TextField & PasswordField) and a button "ok".
    But the LoginContext wants immediately an answer (the login & the password). How can I make the loginContext waiting for the button click.
    I tried with a
    while(!buttonClicked);
    but it's not a good solution.
    I also tried with a Thread inside this loop while and sleeps (during a 500 ms). But I think there's a better solution...
    Can I make a wait, and a notify for this or not.
    Thank you for your help.
    Yann
    -- http://www.objectweb.org/jonas

    Why don't you use the JOptionPane class.
    I think it provides all that you need.
    For example use the method :
         String pass = "azedvge";
         JPasswordField passwordField = new JPasswordField(20);
         int result = JOptionPane.showConfirmDialog(parentComponent, password, "Password check", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
         if (result == JOptionPane.OK_OPTION) {
              String p = new String(passwordField.getPassword());
              if (p.equals(pass)) {
                   // OK !
              else {
                   System.exit(0);
         else {
              System.exit(0);
    I hope this helps,
    Denis

  • Check Button Not Working on Portal for BI report

    We have Vendor account group variable when I enter any random value and click on check its not working its not giving message as ' Invalid Input' on Portal ( Variable is single input optional variable) same Check Button Working in RSRT .
    And For all other Infoobjects ( Plant , Profit center) check Buitton is working on Port as well in RSRT.
    Please suggest.

    done

  • mx:states & button click problem.

    Hi,
    I use <mx:states> build two screen,(base state and
    screen).
    I have button on <base state>,for the click event I add
    the code like
    <mx:Button x="105" y="323" label="Button"
    click="currentState='screen1'" id="button1"/>
    But when I put the button in a mxml component and then I add
    the component on base state.
    I get error when I use the same code and click the button.
    MAIN PAGE
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" xmlns:CTComp="*">
    <CTComp:page1 id="page11"/>
    </mx:Application>
    page1.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="400" height="300">
    <mx:Label x="51" y="89" text="Requestor"/>
    <mx:TextInput x="133" y="87"/>
    <mx:Button x="133" y="136" label="Login" width="103"
    click="currentState='screen2'"/>
    <mx:Label x="112" y="33" text="Catering Request Form"
    width="158" fontWeight="bold" fontSize="12"/>
    </mx:Canvas>
    How to fix the button event on mxml component?Thanks for help
    M

    To get this working correctly, you need to import
    mx.core.Application:
    <mx:Script>
    <![CDATA[
    import mx.core.Application;
    ]]>
    </mx:Script>
    Then you can access the
    Application.application.currentState='yourState' through your click
    handler:
    click="Application.application.currentState='yourState'"

  • I am writting a test  using a sequencer to test for multiple button click

    I'm using flex sdk 4.1 and have a situation where a  button click is sometimes called twice. I am writting a test for this using a sequencer and it will run for at least one button click, what I am not sure is how to test for multiple click events(which shouldn't happen, but occours randomly in my project)
    package tests.view
        import flash.events.MouseEvent;
        import flexunit.framework.Assert;
        import mx.events.FlexEvent;
        import org.flexunit.async.Async;
        import org.fluint.sequence.SequenceEventDispatcher;
        import org.fluint.sequence.SequenceRunner;
        import org.fluint.sequence.SequenceWaiter;
        import org.fluint.uiImpersonation.UIImpersonator;
        import views.AddComments;
        public class TestAddComments
            private var view:AddComments;
            [Before(async,ui)]
            public function setUp() : void
                view = new AddComments;
                Async.proceedOnEvent( this, view, FlexEvent.CREATION_COMPLETE, 600 );
                UIImpersonator.addChild( view );
            [Test]
            public function testButtonClick():void
                view.addCommentBtn
                var sequence:SequenceRunner = new SequenceRunner( this );
                sequence.addStep( new SequenceEventDispatcher( view.addCommentBtn, new MouseEvent( 'click', true, false ) ) );
                sequence.addStep( new SequenceWaiter( view.addCommentBtn, MouseEvent.CLICK, 100 ) );
                sequence.run();

    The only way you could test for that type of circumstance... one where something may happen... is to do so with a timeout. In other words, you cannot let the test pass simply because the first event occurred.
    Two ways to handle this... with sequences:
    Instead, you write a test that expects 2 clicks. In the assertion handler (which would only be reached if both clicks occur) you would fail the test:
    fail('i shouldnt be here');
    In the Waiter for the 2nd click, you would specify a timeout handler. That timeout handler will get called in the 2nd click does not occur in the specified time... (finding that time is the hard part). The default timeout handler fails the test, however, in your case, your timeout handler would just happily do any assertions needed and move on. A timeout does not necessarily mean failure... in your case, it is correct
    Second choice:
    You could create a timer. Create an event handler for the button click which increments a counter. Start the timer, do your test. However, have your test pending on the timer's completion rather than something like the click.. In that case, you would then be able to just check the count:
    private var clickCount:int = 0;
    [Test]
    public function testButtonClick():void {
         var timer:Timer = new Timer( 100, 1 );
        Async.handleEvent( this, timer, TimerEvent.COMPLETE, checkClickCount );
         view.addCommentBtn.addEventListener( 'click', function( e:Event ):void { clickCount++ } );
         view.addCommentBtn.dispatchEvent( new MouseEvent( 'click;, true, false ) );
    private function checkClickCount( e:Event ):void {
    assertEquals( 1, clickCount );
    However, I can't imagine how the test you are describing could ever yield more than one click event... I am guessing the problem is elsewhere, but this will help you verify
    Mike

  • BADi For Shopping Cart "Check" Button

    When Shopping, is there a BADI for the Shopping Cart "Check" button?
    If none, how can I add additional functionality/processing when the Check button is clicked or Enter is triggered? I could not see the buttons in the screen.
    Regards,
    Al

    Hi,
    When 'Check' button is pressed, following BADI's are trigered.
    BBP_ACC_CHECK_ICC
    BBP_MESSAGES_BADI
    BBP_WFL_APPROV_BADI
    BBP_SC_VALUE_GET
    BBP_ACC_CHANGE_ICC
    BBP_DOC_CHECK_BADI
    kindly check for all of these
    If you want to check by yourself, then Follow the steps below:
    1. Create the shopping cart and add test item
    2.Activate the External Debugger in SRM GUI, on the method 'Get Instance' of class CL_EXITHANDLER in tcode st05.
    3. Now click on 'Check' button and when the control moves to the dubugging screen, then press F8 and you can see all the badi which  are getting triggered.
    Thanks & Regards
    Ankur

  • No more mouse click sounds for buttons on Captivate 5

    I have been working on a project that uses buttons and click boxes.  Previously the mouse click played when the button was selected, but now there is no mouse click sound when selecting the button.  When closing the application I see a message that pops up saying "Discovering Unreachable Audio".
    I also tried to create a new project with buttons and the mouse click still does not play.
    I double checked in the properties for the button and the box for "Disable Click Sound" is NOT checked, so I know that this is not the problem.
    I am using Windows XP SP3.
    Any advice on how to correct this is greatly appreciated!
    Thanks

    Did you ever find a solution to this?  I am having the same trouble.  The mouse click will not play despite the fact it is selected.  Some mouse clicks will play so I don't know what the issue is.  Also if I change it to a custom mouse click it the sound will play.

  • HELP FOR OPEN IE FROM BUTTON CLICK ?

    Hello All,
    i make a jframe i want to open internet explorer window for particuler site by button
    click any body tell me plz.
    Thanks ...
    Arif.

    See this Application below, use it in your application
    //to open an application during the run time use runtime
    //n no of applications can be opened during the run time
    import java.awt.*;
    import java.io.*;
    public class RT
    public static void main(String str[])
    try
    Runtime rt = Runtime.getRuntime();
    rt.exec("notepad"); //exit or execute
    // rt.exec("wordpad");
    rt.exec("c:/progra~1/netscape/communicator/PROGRAM/NETSCAPE.EXE");
    /* Process p = exec(perl xyz.pl);
    DataInputStream dis = new DataInputStream(p.getInputStream());
    System.out.println(dis.readLine()); */
    catch ( Exception e)
    e.printStackTrace();

  • How can I display a new scene in JavaFX 2.2? For example after button click

    how to display new scene after button click in the main window, I want the main window and the new scene are in one stage. thx

    You can change the scene by calling stage.setScene(new Scene(newContentParent));
    I don't think you are quite asking for a complete scene change though as you "want the main window and the scene in one stage". The main window is a stage (as Stage extends Window). And a given stage can only contain one scene at a time (though you can swap it out by calling setScene as described earlier).
    What I think you are really asking for how can you replace some content part of the active Scene on the Stage. To do that you can set a layout manager like a HBox or a BorderPane as the root of your scene, then change out the content of the layout manager. For example:
    final BorderPane layout = new BorderPane();
    layout.setCenter(new Label("Dogbert");
    final Button nav = new Button("Next");
    layout.setLeft(nav);
    nav.setOnAction(new EventHandler<ActionEvent>() {
      @Override public void handle(ActionEvent actionEvent) {
        layout.setCenter(new Label("Dilbert"));       
    });In the above short sample code, if you wanted to change the scene rather than the a pane, then you would call stage.setScene rather than layout.setCenter.
    There is a complete executable example with multiple content panes and some styling here:
    http://stackoverflow.com/questions/13556637/how-to-have-menus-in-java-desktop-application

  • How to redirect to library on button click in sandbox visual web part solution for office 365

    Hi,
    I have created a sandbox solution for Office 365 with one text box and a button. 
    On button click i am creating a library with name from text box. 
    So, what i want is redirect to newly created library as soon it get created on button click.
    how could i do that?
    Thanks

    Got the solution
    <asp:Literal ID="litRedirect" runat="server" />
    string redirectURL =
    listurl;
    litRedirect.Text = "<script type='text/javascript'>window.location = '" +
    redirectURL + "/';</script>";

  • Making a video appear by clicking a button on that same state.

    I have a state that I want to open which has an image background and buttons to the side. When a user clicks on one of the buttons I want the video to appear over the graphic. Is there a way to do this?
    I also need to have different movies play in that same player based on which button the user clicks on in that state. Is that possible too?

    Best way is to have a separate state that's a copy of the first, just with a video player. An alternative is to do something like set the opacity on a button click to take a video player from invisible to visible.
    In terms of playing different videos, just have each button set the source property on the video player. On Click > Play Action Sequence > Set Property > Source.
    -Bear

  • Can I have an action occur only after a button / click box is clicked and held for three seconds?

    Within Captivate, I am trying to simulate touching and holding a button for three seconds on a touch pad to get a second window to come up.  I have an image of the touchpad and an image of the second window.  Now I have to set up the interaction.  Is it possible for me to have an image "show" -- in this case, the second window -  only after a click box or button is held for three (or more) seconds?
    Thanks for any help!
    Ryan

    Hi TLCMediaDesign,
    That sounds very interesting and I would like to learn how to do it. I just read Common JS interface and I know how to manipulate the output at runtime using the JS console, but that is all I really know how to do...
    To understand your answer, I had to make a few assumptions.  When you say JS "post publishing", you mean going into one of the JS files that get published with the project such as standard.js and manipulating that.  Is that correct?
    My second question has to do with the event listener.  I have some experience with JS in the past and manipulating HTML elements, for example.  How do I find a particular button, or any Captivate object in the JS?  HTML elements always have IDs and classes...
    Thanks for any help..

  • In iphoto there is a one click button in edit for enhance which I find very useful, in Aperture 3 is there the same quick edit ?

    In iphoto there is a one click button in edit for enhance which I find very useful, in Aperture 3 is there the same quick edit ?

    Hello Michael,
    Yes, there is. Look in the Inspector - Adjustment Tab:
    In the "Presets-Selector -> Quick Fixes" you will find "Auto Enhance"
    Regards
    Léonie

Maybe you are looking for

  • Twitter App. for 1st Gen. iPod Touch

    I recently was having problems with the Twitter App. on my 1st Gen. iPod Touch and so decided to delete the app and re-download it again, like I had done a week earlier. During the download an error message popped up stating that I need ios 6 or late

  • Payment medium Program RFFOBR

    Hi people, We need to create the variant to "Payment medium Program RFFOBR". Some time ago we worked with the transaction SE38, put the program: RFFOBR_U and create our Variants. But now, this transaction is considered critical in our company and it

  • Armada 1580DMT BIOS Update needed

    Hello from Bulgaria I'm a HP Compaq user from forever and I've always been happy with the laptop products. I currently own a Pavilion dv6-1080eq. I still keep the first laptop I got, it's an Armada 1580DMT. I want to bring this old fighter back to li

  • Why is this page slowing down in Internet Explorer ?

    The swapping of images is so slow on this page. Is this the SwapImage() function in Dreamweaver ? The reason I am asking is that all other browsers tackle this very well. So, if somebody has any idea why this is so I would appreciate it sooooooo much

  • NI 488: command requires GPIB controller to be controller in charge

    Hi I'm trying to simulate a charge controller for an electrical vehical prototype. I'm using cRIO for communication between the charging station and LabVIEW. Sometimes while running the program, the above error is displayed and I have to restart the