[4721] in java-interest
Re: return key event
daemon@ATHENA.MIT.EDU (Sami Shaio)
Thu Jan 11 16:07:28 1996
Date: Thu, 11 Jan 1996 11:26:30 -0800
From: Sami.Shaio@Eng.Sun.COM (Sami Shaio)
To: java-interest@java.Eng.Sun.COM, robert+@andrew.cmu.edu
The return key in a textfield is special since it will send an
EVENT.ACTION_EVENT event to the textfield. You can do what you want
either by overriding the "action" method in your textfield or by
catching the relevant event.
--sami
|From robert+@andrew.cmu.edu Mon Jan 8 14:02:12 1996
|Date: Mon, 8 Jan 1996 16:45:02 -0500 (EST)
|From: Robert W Armstrong <robert+@andrew.cmu.edu>
|To: java-interest@java
|Subject: return key event
|X-Info: To unsubscribe, send 'unsubscribe' to java-interest-request@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
|
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com