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

    Smile Changing Active Window


    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
    Blog Entries
    Rep Power


    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, 07:53 AM
  2. How to change backgrnd color of link(active)
    By Captainz in forum New To Java
    Replies: 1
    Last Post: 05-03-2008, 12:10 AM
  3. Active Content enable problem
    By kasipandian in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 02-01-2008, 03:15 PM
  4. Accessing Active Directory
    By javaplus in forum Advanced Java
    Replies: 1
    Last Post: 01-05-2008, 12:25 AM
  5. Replies: 0
    Last Post: 08-03-2007, 05: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