| Author |
Executing External Command with a Twist
|
ManChun Lam
Greenhorn
Joined: May 04, 2008
Posts: 28
|
|
I have an external application that I want to call in my Java program. I have already successfully implemented the call. Now, the twist is that, if I hold "Ctrl" and execute this external program, a console (for debug) will pop up. I'm not aware of any command line switch that can do the same thing for this particular program. Is there a way, in Java, to simulate the action of "press and hold "Ctrl", then execute the external program"? Thank you.
|
 |
Sachin Joshi
Ranch Hand
Joined: Aug 06, 2008
Posts: 83
|
|
What is the way you are taking input from user? Is it a user interface like Swing/AWT or you are taking input from command line? Capturing the key press can be done using event based programming in Swing/AWT you need to fire an event for a key press, and then check if the key pressed is control key. And based on the type of key you can take different action.
|
Web Development Tips and Tutorials - By Sachin
|
 |
ManChun Lam
Greenhorn
Joined: May 04, 2008
Posts: 28
|
|
|
What I'd like is to "hard-code" the "press Ctrl" event, so that I can just call the external program and a debug dialog will pop-up. Thank you.
|
 |
ManChun Lam
Greenhorn
Joined: May 04, 2008
Posts: 28
|
|
|
I found the "Robot" class in the Java API that looks like what I want. I will give it a try.
|
 |
 |
|
|
subject: Executing External Command with a Twist
|
|
|