Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Need Help for Robot class even on inactive window

  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need Help for Robot class even on inactive window

    Recently, I've learn a little on how to use Robot class and Multi-threading..
    Using what i've learnd, Im developing a program that continuously posting on a chatbox in an ACTIVE window..and I did it well..
    until I realize that its better to keep the program running and posting even when the window is inactive so that I can still perform other task on other window...Is there a way how to make it?If you have an idea, i realy need ur help! tnx
    Last edited by jamsubzero; March 4th, 2011 at 11:33 PM.


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Need Help for Robot class even on inactive window

    Unfortunately, the Java Robot class only allows you to "simulate" what the user can do, i.e. move/press the mouse somewhere, or press a keyboard. It can't send a direct virtual event to another program. I believe the only way around this is by writing a low-level API in C/C++, then using JNI to interface with it, or alternatively find one that someone else has made.

  3. #3
    Junior Member
    Join Date
    Mar 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Need Help for Robot class even on inactive window

    thanks sir for the reply..
    oh my!sir, do you have an idea where can I find a low level API for that?
    and another problem is, I have nothing about JNI..

  4. #4
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Need Help for Robot class even on inactive window

    I'm not aware of any, likely you'll have to write your own (unfortunately, I'm not sure how you would do this, google should be able to help you, though).

    There's a pretty good tutorial (albeit a little old) at JavaWorld about how to use JNI (note: there will be C/C++ programming involved).

    Link: Enhance your Java application with Java Native Interface (JNI) - JavaWorld

Similar Threads

  1. Replies: 8
    Last Post: April 21st, 2013, 08:20 AM
  2. How to Sendkeys to an application in Java using the Robot Class
    By JavaPF in forum Java SE API Tutorials
    Replies: 6
    Last Post: August 4th, 2011, 12:13 AM
  3. Craating non active window ,and inputing to the non active window.
    By java-beginner in forum Java Theory & Questions
    Replies: 0
    Last Post: February 25th, 2011, 10:13 PM
  4. cmd.exe DOS Window
    By Curious in forum File I/O & Other I/O Streams
    Replies: 4
    Last Post: March 1st, 2010, 10:30 AM
  5. Robot help.
    By mlan in forum AWT / Java Swing
    Replies: 1
    Last Post: February 14th, 2010, 04:26 PM

Tags for this Thread