Article View: borland.public.jbuilder.java.swing
Article #12069Re: How to set default ENTER and ESCAPE actions?
From: Ernie Rael
Date: Wed, 03 Mar 1999 00:00
Date: Wed, 03 Mar 1999 00:00
18 lines
1154 bytes
1154 bytes
Check out JComponent.registerKeyboardAction, the WHEN_IN_FOCUSED_WINDOW condition seems like what you're looking for. -ernie On Mon, 01 Mar 1999 19:56:50 -0600, Carlos Javier Castro Pena <jcaspen@ittc.ukans.edu> wrote: >How can I set in an JInternalFrame the following: > >-when the user presses ENTER, an enterButton.doClick() is executed >-when the user presses ESCAPE, an escapeButton.doClick() is executed > > >Is there some example? I set the keyPressed() event for each element, >but it work only when the element has focus. I'd like to implement it in >a moregeneral way.
Technical Details
Message-ID:
<36dce7d0.2286062@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<36DB4561.F2B1F55C@ittc.ukans.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,3b20cc5014a3aa77 X-Google-Attributes: gid111d45,public From: err@raelity.com (Ernie Rael) Subject: Re: How to set default ENTER and ESCAPE actions? Date: 1999/03/03 Message-ID: <36dce7d0.2286062@forums.borland.com> X-Deja-AN: 450675167 Content-Transfer-Encoding: 7bit References: <36DB4561.F2B1F55C@ittc.ukans.edu> Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing