Continue after Robot has finished typing

Hi,
I have found a basic example of the Robot class:
public class RobotExample {   
    public static void main(String[] args) {       
        try {           
            Robot robot = new Robot();
            // Robot start writting
            robot.keyPress(KeyEvent.VK_H);
            robot.keyPress(KeyEvent.VK_I);
            robot.keyPress(KeyEvent.VK_SPACE);
            robot.keyPress(KeyEvent.VK_B);
            robot.keyPress(KeyEvent.VK_U);
            robot.keyPress(KeyEvent.VK_D);
            robot.keyPress(KeyEvent.VK_Y);           
        } catch (AWTException e) {
            e.printStackTrace();
    // Code that follows needs to ensure that the Robot has finished typing
}The code that immediately follows the Key Presses remove focus from where the robot is typing so it would be nice to detect when the Robot has finished typing before I continue. At the moment the best way I can think of would be to simply place all the Key Presses in a Thread, telling it to sleep once it had finished. The problem with that is there could still be a problem with the amount of time being too much or too little and no way of finding out.
Does any one have any ideas how I can listen to the Robot events and continue once they have finished?
Thanks

Note: This thread was originally posted in the [Java Programming|http://forums.sun.com/forum.jspa?forumID=31] forum, but moved to this forum for closer topic alignment.

Similar Messages

  • How can I combine multiple animations. (Play another animation after one has finished with a click?)

    How can I combine multiple animations. (Play another animation after one has finished with a click?) Like a slideshow but with animations. any ideas?

    You can do this by calling up the different edge Animate composition html pages using buttons and an iframe:
    To get a general idea, put this in the body of an html page and insert your own URLs where indicated
    <iframe id="iframeID" src="yourFirstURL" width="640" height="480">
    <p>Your browser does not support iframes.</p>
    </iframe>
    <button onclick='loadIframe("iframeID", "firstAnimURL")'>First Animation</button>
    <button onclick='loadIframe("iframeID", "secondAnimURL")'>Second Animation</button>
    <button onclick='loadIframe("iframeID", "thirdAnimURL")'>Third Animation</button>
    <script>
    function loadIframe(iframeID,url) {
    //alert("Hello");
       document.getElementById("iframeID").src = url;
    </script>
    Peter Small

  • IPhoto keeps crashing after 'repair' has finished

    iPhoto 11 9.2.1 consistently crashes even after the 'repair' has finished  
    HELP!!
    Never had a problem with iPhoto10

    Same thing is happening to me.  I upgraded last night and it worked fine.  I marked some "Faces" and all was well.  I turned on Photo Stream and it's crashed consistently every time since.  Here is the error code.  I hope I kept it close to 50 lines. 
    Process:         iPhoto [4552]
    Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Identifier:      com.apple.iPhoto
    Version:         9.2.1 (9.2.1)
    Build Info:      iPhotoProject-628000000000000~1
    App Item ID:     408981381
    App External ID: 4641130
    Code Type:       X86 (Native)
    Parent Process:  launchd [222]
    Date/Time:       2012-02-20 11:37:28.924 -0500
    OS Version:      Mac OS X 10.7.3 (11D50b)
    Report Version:  9
    Interval Since Last Report:          22961 sec
    Crashes Since Last Report:           6
    Per-App Interval Since Last Report:  5505 sec
    Per-App Crashes Since Last Report:   6
    Anonymous UUID: 08841BF0-1204-404D-8E20-3F6B7B501A42
    Crashed Thread:  0 Dispatch queue: com.apple.main-thread
    Exception Type:  EXC_BAD_ACCESS (SIGBUS)
    Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
    VM Regions Near 0:
    --> __PAGEZERO             0000000000000000-0000000000001000 [    4K] ---/--- SM=NUL  /Applications/iPhoto.app/Contents/MacOS/iPhoto
        __TEXT 0000000000001000-0000000000d1b000 [ 13.1M] r-x/rwx SM=COW /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Application Specific Information:
    objc[4552]: garbage collection is OFF
    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0   com.apple.iPhoto                             0x00824501 0x1000 + 8533249
    1   com.apple.iPhoto                             0x001678d6 0x1000 + 1468630
    2   com.apple.Foundation                  0x9ca86e25 __-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_1 + 49
    3   com.apple.CoreFoundation        0x98ed3cb3 ___CFXNotificationPost_block_invoke_1 + 275
    4   com.apple.CoreFoundation        0x98e9ea38 _CFXNotificationPost + 2776
    5   com.apple.Foundation                  0x9ca72012 -[NSNotificationCenter postNotificationName:object:userInfo:] + 92
    6   com.apple.Foundation                  0x9ca872a6 -[NSNotificationCenter postNotificationName:object:] + 55
    7   com.apple.iPhoto                             0x0016716a 0x1000 + 1466730
    8   com.apple.iPhoto                             0x00167111 0x1000 + 1466641
    9   com.apple.iPhoto                             0x0015c6f4 0x1000 + 1423092
    10  com.apple.CoreFoundation                        0x98eebb6d __invoking___ + 29
    11  com.apple.CoreFoundation                        0x98eebaa9 -[NSInvocation invoke] + 137
    12  com.apple.RedRock                       0x01d59e61 -[RKInvoker _invokeTarget:] + 33
    13  com.apple.CoreFoundation                        0x98ee8de1 -[NSObject performSelector:withObject:] + 65
    14  com.apple.Foundation                0x9cac3e40 __NSThreadPerformPerform + 503
    15  com.apple.CoreFoundation                        0x98e603df __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
    16  com.apple.CoreFoundation                        0x98e5fd96 __CFRunLoopDoSources0 + 246
    17  com.apple.CoreFoundation                        0x98e89c68 __CFRunLoopRun + 1112
    18  com.apple.CoreFoundation                        0x98e8947c CFRunLoopRunSpecific + 332
    19  com.apple.CoreFoundation                        0x98e89328 CFRunLoopRunInMode + 120
    20  com.apple.HIToolbox                   0x921e417f RunCurrentEventLoopInMode + 318
    21  com.apple.HIToolbox                   0x921eb412 ReceiveNextEventCommon + 168
    22  com.apple.HIToolbox                   0x921eb356 BlockUntilNextEventMatchingListInMode + 88
    23  com.apple.AppKit                          0x904a7a9c _DPSNextEvent + 678
    24  com.apple.AppKit                          0x904a7306 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 113
    25  com.apple.AppKit                          0x904a3675 -[NSApplication run] + 911
    26  com.apple.AppKit                          0x90737261 NSApplicationMain + 1054
    27  com.apple.iPhoto                           0x0001159a 0x1000 + 66970
    28  com.apple.iPhoto                           0x00010a29 0x1000 + 64041

  • How can I put my iMac to sleep after it has finished downloading or uploading something?

    For example: I have some photos and videos that I want to send to a friend. I'm uploading them to a site to do this, and they're quite big files (250 MB).
    I'd like to do this at night, but I don't want to let the computer run all the night through, when this maybe only needs a few hours.
    I can only guess how long it will take (judging by the time it tells me that it will take, if available), and then I can set the computer to go to sleep after X hours or minutes.
    Can I not just simply set it in a way that it goes to sleep automatically after the process is finished? Like, if there's a connection to the internet, that is being used (downloads, uploads), then it shouldn't go to sleep, else it will interrupt the upload, and I can start again.
    Also, I have an iMovie update now, which is over a GB of download.
    I may be mistaken, but I have the feeling that for some Apple programs, it actually keeps the computer awake until the process is done. But it isn't the case with all programs, only with some.
    It's really annoying. Does anyone know a solution? I know that there's this box that you can tick, that says something like to keep the computer from going to sleep if there's a network connection, but in earlier OS this was actually working! Now it's 100% useless.

    You can just set your Mac to sleep using the Energy Saver in System Pref.  Set it to sleep after say, 2 mins of inactivity then check the Put Hard Disk to Sleep setting too.  It won't sleep while you are down/uploading.

  • CS4 Student Edition - Can my daughter use this for commercial use after she has finished her studies?

    I have searched all day, having phoned 6 different numbers and researched everywhere to not get a definate answer to this question. We are in the UK, I do not want to spend money on software which she cannot legally use after her studies to produce work which she can sell commercially. Some forum answers are relevant for North America only or are a little out of date refering to Education Licenses. Please help!! One person said they embed a watermark to prevent commercial use but is this an education copy or a student edition?

    Within limits, yes, but as you stated you are in the UK, I don't think it is "allowed". Refer to this link: http://www.adobe.com/education/students/studentedition/faq.html
    I'll copy the text for sake of ease.
    Do the Student Editions have restricted functionality?
    Adobe Student Editions give the end user all the features and functionality of the commercial versions. The software may be used only on a privately owned computer, and the end user may not transfer or resell ownership of the Adobe Student Edition license.
    Is there a time limit on using the Student Editions?
    No, there is no time limit on using the Student Editions.
    Can a Student Edition also be used for commercial purposes?
    In North America, Student Edition software can be used for commercial purposes. Outside North America, Student Edition software is for noncommercial purposes only.
    How many versions of a Student Edition can I purchase?
    Each eligible person may purchase only one copy per Adobe Student Edition. For example, a student may purchase only one copy of Creative Suite 4 Design Premium Student Edition. If that student buys an additional copy of Design Premium Student Edition, no serial number will be issued for it.
    How many computers can I use a Student Edition on?
    A Student Edition license can be installed on up to two computers (for example, a desktop and laptop). Activation ensures that no more than two computers can have the same serial number.
    Can I upgrade from a Student Edition?
    Yes, a  Student Edition can be upgraded to a commercial version.
    Can I resell a Student Edition?
    The end user may not transfer or resell ownership of the Adobe Student Edition license.
    Can I use a Student Edition after I graduate?
    Yes, after you graduate, you may continue to use your Student Edition; the license does not expire.
    Can I use a Student Edition  on a computer at school?
    No, you may use your  Student Edition only on your own private computer.

  • About replaying a video after it has finished

    Hi.
    I've dinamically loaded a video in flash at runtime. I made a
    pause button which pauses and resumes the video.
    But i also want the video to replay over and over again after
    it finishes.
    How can i do that through AS 2?

    Does the video no longer show up under the Photos tab? You should be able to edit it there. You can't edit within albums.

  • How to reset bookmark after audiobook has finished playing?

    I get audiobooks through audible.com. When playback is stopped a bookmark is saved. When playback is resumed it is possible to advance or rewind from this point. However, when an audiobook has played through to the end (sometimes accidentally) the book mark is at the very end so that the file does not actually begin to play at all! This makes it impossible to rewind it. The only way I have found to do this is when the iPod is conncected to iTunes where there is a slider associated with the file which can be adjusted. How can a bookmark at the very end of an audiobook file be reset when the iPod is not connected to anything?
    Dell   Windows XP   30 GB Video iPod

    It's possible to do in Captivate 3 by using some JavaScript code. Some have also reported that it works with Captivate 4 but I have not yet tested it myself.
    You can try it out and see if it works out for you. Here is the link with the explanation and code: http://www.cpguru.com/2008/11/25/reset-bookmark-in-captivate-3/
    /Michael
    Visit my Captivate blog with tips & tricks, tutorials and Widgets.

  • I phone 4 will not reboot tells me to connect to itunes after download has finished message comes up on itunes there is a problem with your i phone

    i phone4 turned itself off tells me to connect to itunes goes through the reboot downloads the software then at the end message reads on i tunes there is a problem with your i phone contact nearest store

    Yes. Talk to whoever replaced the battery. Sounds like they broke something.

  • T60, 5 beeps after windows has started.

        Hi
    I have a colleague with a T60 and she experiences that shortly after windows has finished loading (after log on and the programs that autostart have started) it gives 5 beeps. Eventviewer shows nothing and no programs have any sounds set so it is a bios beep, but what does it mean ?
    The hardware manual says that 5 beeps means system board, but the PC seems to be running smoothly with no random crashes, so ???
    Does anyone have an idea ?
    Thanks

    Hello,
    Could the beeping be from another program which is running at startup, such as an accessibility program or a security program?
    Regards,
    Aryeh Goretsky
    I am a volunteer and neither a Lenovo nor a Microsoft employee. • Dexter is a good dog • Dexter je dobrý pes
    S230u (3347-4HU) • X220 (4286-CTO) • W510 (4318-CTO) • W530 (2441-4R3) • X100e (3508-CTO) • X120e (0596-CTO) • T61p (6459-CTO) • T43p (2678-H7U) • T42 (2378-R4U) • T23 (2648-LU7)
      Deutsche Community   Comunidad en Español Русскоязычное Сообщество

  • Stopping after each song has finished

    Is it possible to set up the iPod shuffle so that when a song has finished playing it stops/pauses. Instead of continuing to the next song?

    Haven't tried it on a shuffle, but here is an idea.
    In iTunes, set up a playlist of the stuff you want on the shuffle. Now UNCHECK all the boxes in front of those songs. Also select all then do a get info and check the box to "skip when shuffling". I am not sure if that setting will effect how the songs play on the shuffle or not, but worth a try. If the shuffle does use that setting, then when you play a track, it should stop after that track since all the songs on the shuffle are unchecked and will be skipped.
    Patrick

  • How do I set up iTunes to automatically move on to play the next album after the last one has finished? (in Album view)

    How do I set up iTunes to automatically move on to / play the next album after the last one has finished? (in Album view).
    This used to happen automatically in Genre view.

    Hi Henryhippo,
    If you have questions about play order in iTunes, you may find the following article helpful; I believe you can use the Play Next or Add to Up Next to add albums as well as songs.
    iTunes 11 for Windows: Ways to play songs
    Regards,
    - Brenden

  • After I had finished a call my iPhone 4 just went completely dead. Has anyone heard about this problem before?

    After I had finished a call my iPhone 4 just went completely dead. Has anyone heard about this problem before?

    Hi, I'm not sure if every Off problem is the same...
    I would call Apple Corp or visit the Local Genius Bar......
    Apple do care about pre 5s iPhone owners, give them a chance to help You..

  • Executing code after a transition has finished

    Hi,
    Is there any kind of language construct in JavaFX to allow a certain block of code to be executed after a transition has finished? Or do I have to pause the current thread with sleep() or similar?
    The ideal would be something like this, but of course such a thing like onComplete does not exist AFAIK:
    FadeTransition {node: selectedNode duration: 1s fromValue: 1 toValue: 0 onComplete: executeThis()}.play();

    Hello,
    By "delete node" you mean delete it from scene? This example works for me:
    var stage: Stage = Stage {
        width: 250
        height: 250
        scene: Scene {
            content: [
                text = Text {
                    layoutY: 30
                    opacity: 0.0
                    content: "Example transition"
                Button {
                    layoutY: 70
                    text: "Click me"
                    action: function() {
                       FadeTransition {
                            node: text
                            fromValue: 0.0
                            toValue: 1.0
                            duration: 200ms
                            action: function() {
                                delete text from stage.scene.content;
                        }.play();
    }Saša

  • I have an apple tv and the light blinks continuously after an electrical outage. does this mean my apple tv has been permanently damaged or only resetting is necessary?

    I have an apple tv and the light blinks rapidly and continuously after a power outage. does this mean my apple tv has been permanently damaged?

    Hello there, Philip.
    For understanding the status light on the Apple TV, the following Knowledge Base article offers up some great information on what they mean:
    Apple TV: About the status light - Apple Support
    Apple TV (2nd and 3rd generation)
    Status light
    Apple TV (2nd and 3rd generation) is:
    Flashes quickly
    Having issues. Try restarting or waking your Apple TV. If your Apple TV does not start up properly, you might need to reset the Apple TV or restore it to factory settings. See Apple TV (2nd and 3rd generation): Restoring your Apple TV. If this does not resolve the issue, refer to the Service FAQ for additional assistance.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • (MCTE) .onRollOut after .onRollOver animation has finished

    Hey, so I'm trying to build a website full of these flipping
    movieclips that flip when you mouse-over them, and flip back when
    you mouse out. Problem is, if you mouse out before the flip
    animation has finished, the flipped side stays up, and you have to
    return the cursor over the mc and mouse-out again. I am using
    Jumpeye Components' MCTE V3 as well as the Flip pattern for this,
    in AS2, but I think this is an AS thing not a MCTE problem. I've
    attached the flipping code for one of the movie clips.
    Any help is greatly appreciated.
    Thanks,
    Matt
    Code:

    You can do this by calling up the different edge Animate composition html pages using buttons and an iframe:
    To get a general idea, put this in the body of an html page and insert your own URLs where indicated
    <iframe id="iframeID" src="yourFirstURL" width="640" height="480">
    <p>Your browser does not support iframes.</p>
    </iframe>
    <button onclick='loadIframe("iframeID", "firstAnimURL")'>First Animation</button>
    <button onclick='loadIframe("iframeID", "secondAnimURL")'>Second Animation</button>
    <button onclick='loadIframe("iframeID", "thirdAnimURL")'>Third Animation</button>
    <script>
    function loadIframe(iframeID,url) {
    //alert("Hello");
       document.getElementById("iframeID").src = url;
    </script>
    Peter Small

Maybe you are looking for

  • Problems using Gateway on OWSM 10.1.3.1 and OWSM 10.1.3.3

    Hi, I have a problem reaching a Gateway WSDL defined on OWSM 10.1.3.3. My scenario is the following: I have a SOA Suite 10.1.3.1 on a machine1 and I have defined a Gateway for a Webservice http://arqc:7021/CasaBolsaProxy <?xml version="1.0" encoding=

  • How to disable tabs in titlebar for all users?

    I want to disable tabs in title bar for all users, because looks ugly http://i57.tinypic.com/33nkm77.png I type to C:\Program Files\Mozilla Firefox\defaults\pref\local-settings.js pref("browser.tabs.drawInTitlebar", false); It doesn't work, but any o

  • Put automatic layer opening as an option

    When selecting a different main layer the layer I was previously working on and which I had closed suddenly pops open again, crowding up my already long layer window. I've tried to remember to have all layers closed except the one I am working on and

  • Missing 50GB's after installing Leopard on new HD-best way to re-install

    I installed Leopard on a G5 tower with 2 new 750 GB's seagate drives. Disk Utility shows a total capacity of 698.6 GB's out of 750 GB's so I am missing 50 GB's. Also first aide hangs up on Verify/repair disk permissions. It looks like I am dealing wi

  • Server Admin can't connect to my server

    I updated to 10.4.10 and since then I haven't been able to connect to my server using Server Admin or Server Monitor. In my system.log i get the following error over and over again: /Applications/Server/Server Admin.app/Contents/MacOS/Server Admin: [