Results 1 to 2 of 2
  1. #1
    jmHoekst is offline Member
    Join Date
    Jun 2008
    Posts
    14
    Rep Power
    0

    Smile Changing Active Window

    Greetings,

    I am using a Robot object to simulate typing commands into a console. However, the console window might not always be the active window, so I am wondering if there is a way to change which window is active.

    Using mouse movement and clicking will not help because this application will be done on many systems, with different resolutions, icon placements, etc.

    One option I have is to simply use Java to open the application, making sure it is active, but this program has a GUI and a console. When it is opened, the GUI is active, and not the console, so keystrokes won't do anything there.

    Any ideas? Thanks in advance.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    This sounds like a problem that deals with operations close to the OS, something Java is weak on. If Windows, one solution is to use the JNI library to link with a C or C++ program that makes calls to user32 functions.

    I don't know of any pure Java way to do this, but I'd love to learn if anyone knows of any.

Similar Threads

  1. Check Menu active
    By Mir in forum AWT / Swing
    Replies: 0
    Last Post: 06-12-2008, 06:53 AM
  2. How to change backgrnd color of link(active)
    By Captainz in forum New To Java
    Replies: 1
    Last Post: 05-02-2008, 11:10 PM
  3. Active Content enable problem
    By kasipandian in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 02-01-2008, 02:15 PM
  4. Accessing Active Directory
    By javaplus in forum Advanced Java
    Replies: 1
    Last Post: 01-04-2008, 11:25 PM
  5. Replies: 0
    Last Post: 08-03-2007, 04:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •