Results 1 to 9 of 9
- 08-14-2010, 07:49 AM #1
is it possible to do this to methods?
String gg = "KeyEvent.VK_1";
could i some how put the gg variable in replace so its like robot.keyRelease(g);
Now i know the above code doesnt work, but is there a way like this to do it?Teaching myself java so that i can eventually join the industry! Started in June 2010
- 08-14-2010, 10:05 AM #2
- 08-14-2010, 11:01 AM #3
oh i see, good news. Im loving Javas flexibility to be honest.Teaching myself java so that i can eventually join the industry! Started in June 2010
- 08-14-2010, 02:39 PM #4
Since keyRelease takes an int, not a String, you could code it this way:
int gg = KeyEvent.VK_1;
- 08-14-2010, 02:42 PM #5
- 08-14-2010, 02:59 PM #6
Sorry, I don't see how reflection converts a String to an int.
Sounds more like a javac function, but that is into byte code which could be returned as an int via a method call.
- 08-14-2010, 03:09 PM #7
- 08-14-2010, 03:32 PM #8
Thanks for that.
That's my new thing learned for today.
Last edited by Norm; 08-14-2010 at 03:37 PM.
- 08-14-2010, 04:01 PM #9
- By dreamingofgreen in forum New To JavaReplies: 8Last Post: 04-17-2012, 12:00 AM
- By bdario1 in forum New To JavaReplies: 33Last Post: 03-25-2010, 04:26 AM
- By lilac87 in forum New To JavaReplies: 7Last Post: 07-22-2009, 07:37 PM
- By ejs7597 in forum New To JavaReplies: 4Last Post: 04-03-2009, 07:36 AM
- By Zensai in forum New To JavaReplies: 10Last Post: 12-03-2007, 06:31 AM