[4596] in java-interest

home help back first fref pref prev next nref lref last post

return key event

daemon@ATHENA.MIT.EDU (Robert W Armstrong)
Mon Jan 8 18:10:46 1996

Date: Mon,  8 Jan 1996 16:45:02 -0500 (EST)
From: Robert W Armstrong <robert+@andrew.cmu.edu>
To: java-interest@java.sun.com

I have a program in which I create a Dialog and place a Textfield in it
with two buttons, Ok and Cancel. As it is, the user types something in
the Textfield and then can either click on Ok or Cancel and have the
desired effect. In addition, I want the user to be able to press the
return key and have the same effect as clicking on the Ok button. I had
assumed I would have to check for an Event with a KEY_PRESS id and it's
key set to '\n' or something of that nature. After doing some testing,
what I need appears to be an Event with an id of 1001, or Event.END. Is
this correct? From looking at java.awt.Event it seems as if Event.END is
to be used for the 'end' key, not the return key. Any help in resolving
my confusion would be greatly appreciated.

robert



-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post