Results 1 to 2 of 2
Thread: Changing Active Window
- 06-13-2008, 11:13 PM #1Member
- Join Date
- Jun 2008
- Rep Power
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.
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.
- By Mir in forum AWT / SwingReplies: 0Last Post: 06-12-2008, 07:53 AM
- By Captainz in forum New To JavaReplies: 1Last Post: 05-03-2008, 12:10 AM
- By kasipandian in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 02-01-2008, 03:15 PM
- By javaplus in forum Advanced JavaReplies: 1Last Post: 01-05-2008, 12:25 AM
- By nihar1213 in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 08-03-2007, 05:21 PM