How to implement Key logger using java

Hii all,I like to know how to record all keystrokes typed in any application window & to maintain a log file of it. Im a beginner in java so plz It would be helpful if someone help me reg. this.
[212 byte] By [Nethilia] at [2007-10-1 18:08:15]
# 1

just add an action listener (either keypressed or keytyped) to the frame that you want to record. I did this in NetBeans in about 2 seconds. I can simplify it if you need. As for loging it just write the characters to a file output stream.

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.

*/

// <editor-fold defaultstate="collapsed" desc=" Generated Code ">

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();

}

// </editor-fold>

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

}

happyfeeta at 2007-7-11 12:49:44 > top of Java-index,Security,Other Security APIs, Tools, and Issues...
# 2
Hi.. i hv gone thru' the code dat u hv specified. but i coulndt find any output i nstead of a blank frame.can u send a full working code. also an u provide the details about hw to implement key logger in remote system..its really urgentplz help methanks in
java_asp_jspa at 2007-7-11 12:49:44 > top of Java-index,Security,Other Security APIs, Tools, and Issues...