Last active
August 29, 2015 13:56
-
-
Save Sciss/9154688 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing._ | |
val f = new JFrame | |
val p = f.getContentPane.asInstanceOf[JComponent] | |
p.addKeyListener { | |
new java.awt.event.KeyAdapter { | |
override def keyPressed (e: java.awt.event.KeyEvent): Unit = println(e) | |
override def keyReleased(e: java.awt.event.KeyEvent): Unit = println(e) | |
override def keyTyped (e: java.awt.event.KeyEvent): Unit = println(e) | |
} | |
} | |
f.setSize(200, 200) | |
f.setVisible(true) | |
p.requestFocus() |
Author
Sciss
commented
Mar 5, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment