🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #9790

Re: Can't activate JButtons within an applet using the keyboard

#9790
From: Tor Iver Wilhelmsen
Date: Fri, 28 Jan 2000 00:00
15 lines
1153 bytes
"Jeff Marendo" <marendoj@commos.com> writes:

> I'm trying to figure out why the JButtons I'm using in my applet won't
> execute their associated actionListener functionality when I hit either
> 'Enter' key on my keyboard.

If I recall the interface guidelines correctly, hitting SPACE counts
as a click on the currently selected button. ENTER should fire the
"default button", which you set using
getRootPane().setDefaultButton().

(However, they only went half-way, because they ought to add the
ability to register a default ESC behaviour - currently you need to
add a keyboard action to trigger e.g. cancelButton.doClick() or
something.)
Technical Details
Message-ID: <uvh4e5vve.fsf@sds.no>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <86q9cg$ria10@bornews.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,9877ed777dc9eea8
X-Google-Attributes: gid111d45,public
From: Tor Iver Wilhelmsen <tor.wilhelmsen@sds.no>
Subject: Re: Can't activate JButtons within an applet using the keyboard
Date: 2000/01/28
Message-ID: <uvh4e5vve.fsf@sds.no>
X-Deja-AN: 578697012
Sender: towi@SDSA1761
References: <86q9cg$ria10@bornews.borland.com>
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.swing