Thank you for your reply. Yes, when I press ALT-B, the book button fires as expected. I think the bold code above is to mimic the action of pressing ALT-B in the keyboard, but it doesn't work this way. After I enter something in the ownerText and press the Enter key, nothing happens. Could you give me some idea of it?
Thanks in advance! Ailsa Cape
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
0
> Yes, when I press ALT-B, the book button fires as expected.
your robot only presses B
Ailsa Cape
Ranch Hand
Joined: Aug 10, 2005
Posts: 92
posted
0
Hi, Michael
How to make the robot presses ALT-B instead of B?
Thanks in advance! Ailsa Cape
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
0
experiment a little
you have robot.keyPress(KeyEvent.VK_B); robot.keyRelease(KeyEvent.VK_B);
what about trying robot.keyPress(KeyEvent.VK_ALT); robot.keyPress(KeyEvent.VK_B); robot.keyRelease(KeyEvent.VK_B); robot.keyRelease(KeyEvent.VK_ALT);
Ailsa Cape
Ranch Hand
Joined: Aug 10, 2005
Posts: 92
posted
0
Hi, Michael
Thank you! It works. The book button's shortcut key is B in the keyboard when I use "book.setMnemonic(KeyEvent.VK_B)". I don't know why I should have to press ALT-B to fire the button?
Thanks in advance! Ailsa Cape
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.