Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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"); }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #keylistener #jframe
ADD COMMENT
Topic
Name
9+1 =