🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Default Push Button

#11138
From: Max Polk
Date: Sat, 10 Jul 1999 00:00
19 lines
1268 bytes
In article <7m5lpe$kmp2@forums.borland.com>,
sbroder@xylan.com says...
> I want to have a default push button for my OK button.  I found
> the setDefaultButton() call and it does make the OK button look like a
> default push button but when I try to run the dialog and press the enter key
> nothing happens.

You go to the field you are pressing [Enter] in and look for that 
keypress.  When you get the keypress in the field you are typing in, have 
it call the method the action event listener for the button push calls.

In other words, each field you press [Enter] in manually calls whatever 
the button push calls.

I know about setting an entire panel to receive a [F1] key in any field.  
Perhaps this can be used to capture [Enter] pressed anywhere in a panel?

-- 
I grant this to the public domain
Technical Details
Message-ID: <MPG.11f1270626edd2fa989702@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7m5lpe$kmp2@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,c4ef4341a8cc789d
X-Google-Attributes: gid111d45,public
From: none@none.invalid (Max Polk)
Subject: Re: Default Push Button
Date: 1999/07/10
Message-ID: <MPG.11f1270626edd2fa989702@forums.borland.com>
X-Deja-AN: 499467731
References: <7m5lpe$kmp2@forums.borland.com>
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.swing