public class test extends javax.swing.JFrame { /** Creates new form test */ public test() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // private void initComponents() { setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); addKeyListener(new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { formKeyTyped(evt); } }); pack(); } // private void formKeyTyped(java.awt.event.KeyEvent evt) { System.out.println(evt.getKeyChar()); } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new test().setVisible(true); } }); } // Variables declaration - do not modify // End of variables declaration }