Possible to capture what user has typed before <CR> hit?

M

Mabel

Dear all,

Is it possible to get what user has typed in before he hit
carriage return?

Thkx.
 
B

BADBOY

Never tried this before but, if i was to.. i`d start with implementing the
java.awt.event.KeyListener class in the top level object eg :-
class MyKeyTest extends JFrame implements java.awt.event.KeyListener{
public MyKeyTest(){
super();
}
public void keyPressed(KeyEvent e){}
public void keyReleased(KeyEvent e){}
public void keyTyped(KeyEvent e){}
}

no idea if this will do what you are trying to achieve, but must be a good
place to start :)
if not maybe try extending the Object thats receiving the key strokes and
implementing KeyListener in that.

Jonney.
 
M

Mabel

BADBOY said:
Never tried this before but, if i was to.. i`d start with implementing the
java.awt.event.KeyListener class in the top level object eg :-
class MyKeyTest extends JFrame implements java.awt.event.KeyListener{
public MyKeyTest(){
super();
}
public void keyPressed(KeyEvent e){}
public void keyReleased(KeyEvent e){}
public void keyTyped(KeyEvent e){}
}

no idea if this will do what you are trying to achieve, but must be a good
place to start :)
if not maybe try extending the Object thats receiving the key strokes and
implementing KeyListener in that.

Jonney.

Thx. I'll try that out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,438
Messages
2,571,699
Members
48,796
Latest member
Greg L.
Top