B
Brian
Hi
I'm trying to implement a keylistener to my application.
The page contains six JButtons to start different part of the
application - that works.
I want to implement a key shortcut to each part but I can't get i to
work.
I've tried to add the keylistener to the frame, the panel and the
button - eact time without luck.
In my Keylistener i write:
public void keyTyped(KeyEvent event) {
if(event.getKeyCode()==KeyEvent.VK_F1)
System.out.println("test");
}
What am I doing worng - and can someone give me an example?
Thanks
Brian
I'm trying to implement a keylistener to my application.
The page contains six JButtons to start different part of the
application - that works.
I want to implement a key shortcut to each part but I can't get i to
work.
I've tried to add the keylistener to the frame, the panel and the
button - eact time without luck.
In my Keylistener i write:
public void keyTyped(KeyEvent event) {
if(event.getKeyCode()==KeyEvent.VK_F1)
System.out.println("test");
}
What am I doing worng - and can someone give me an example?
Thanks
Brian