Answers for "add key listener to jframe"

1

how to add a keylistener to a jframe

System.out.println("test");
frame.addKeyListener(new KeyListener() {
    public void keyPressed(KeyEvent e) { System.out.println( "tester"); }

    public void keyReleased(KeyEvent e) { System.out.println("2test2"); }

    public void keyTyped(KeyEvent e) { System.out.println("3test3"); }
});
Posted by: Guest on February-15-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language