Results 1 to 9 of 9
- 08-14-2010, 06: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, 09:05 AM #2
- 08-14-2010, 10: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, 01: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, 01:42 PM #5
- 08-14-2010, 01: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, 02:09 PM #7
- 08-14-2010, 02:32 PM #8
Thanks for that.
That's my new thing learned for today.
Last edited by Norm; 08-14-2010 at 02:37 PM.
- 08-14-2010, 03:01 PM #9
- By dreamingofgreen in forum New To JavaReplies: 8Last Post: 04-16-2012, 11:00 PM
- By bdario1 in forum New To JavaReplies: 33Last Post: 03-25-2010, 03:26 AM
- By lilac87 in forum New To JavaReplies: 7Last Post: 07-22-2009, 06:37 PM
- By ejs7597 in forum New To JavaReplies: 4Last Post: 04-03-2009, 06:36 AM
- By Zensai in forum New To JavaReplies: 10Last Post: 12-03-2007, 05:31 AM