txtBox.addKeyListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
Type();/* this will go to your function Type() */
}
});
Public void Type() {
txtBox.getText();
/*not exactly sure what you want but this is just a quick example of what you can do */
}