Hey ... told you I'd get back ...
the below class shows the way ... make sure in your code when you adapt it that you call the aKeyListener() method in you main() or whatever - it just sits in the background listening for specified key events.
By the way ... hint hint .. vote "helpful" on the "Mark this post as helpful/expert post!" link at bottom of page !!!!
PS - key identifiers are of the constants "KeyEvent.VK_BLA" - so the 'up arrow' key is VK_UP, f5 is VK_F5 etc...
Ben.
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class TestKey {
static JFrame f;
public static void main(String[] args) {
TestKey tk = new TestKey();
tk.aKeyListener();
}
public static void aKeyListener() {
f = new JFrame();
f.setSize(200, 200);
f.setVisible(true);
f.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_F4) {
System.out.println("hello f4"

;
}
}
});
}
}