Toolkit tk = Toolkit.getDefaultToolkit();
KeyboardFlasher flasher = new KeyboardFlasher();
tk.addAWTEventListener(flasher, AWTEvent.KEY_EVENT_MASK);
JFrame frame = new JFrame("Hack #63: Keyboard Flasher");
JTextField tf = new JTextField("this is some text");
frame.getContentPane().add(tf);
frame.pack();
frame.setVisible(true);