🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Button related question

#70
From: Paul Nichols [TeamB]
Date: Sat, 17 Dec 2005 04:57
19 lines
1641 bytes
Alexey N. Solofnenko wrote:

> I think you are looking for this:
> dialog.getRootPane().setDefaultButton(submitButton);
> 
> - Alexey.
> 
> GEORGE wrote:
>> Paul,
>> 

>> I have a dialog with bunch of controls one of which is the OK button. 
>> What I want is that should the user press Enter when this dialog has been
>> activated,  then the actionPerformed of the OK button should be executed
>> (even if the cursor is currently in , say, a text field).   Hope this
>> makes sense.
 
This is definitely the easiest way for a single key event for a single
button and a single keystoke.
Technical Details
Message-ID: <43a244c8@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!cyclone1.gnilink.net!gnilink.net!nx01.iad01.newshosting.com!newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <43a208cd@newsgroups.borland.com> <43a22b75@newsgroups.borland.com> <43a22e54$1@newsgroups.borland.com> <43a23efa$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,84ac8c3cf3b463d
X-Google-Attributes: gid111d45,public
X-Google-Language: ENGLISH,ASCII-7-bit
Message-ID: <43a244c8@newsgroups.borland.com>
From: "Paul Nichols [TeamB]" <paul@comp.net>
Subject: Re: Button related question
Newsgroups: borland.public.jbuilder.java.swing
Date: Fri, 16 Dec 2005 22:57:01 -0600
References: <43a208cd@newsgroups.borland.com> <43a22b75@newsgroups.borland.com> <43a22e54$1@newsgroups.borland.com> <43a23efa$1@newsgroups.borland.com>
Lines: 20
User-Agent: KNode/0.9.2
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
NNTP-Posting-Host: 68.113.120.52
X-Trace: newsgroups.borland.com 1134707912 68.113.120.52 (15 Dec 2005 20:38:32 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!cyclone1.gnilink.net!gnilink.net!nx01.iad01.newshosting.com!newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail