Article View: borland.public.jbuilder.java.swing
Article #158Re: Pre-Selected Button
From: Magnus
Date: Fri, 05 May 2006 16:07
Date: Fri, 05 May 2006 16:07
19 lines
1527 bytes
1527 bytes
Simpler then expected :) I put: getRootPane().setDefaultButton(okButton); after the call to jbInit(); in my constructor. Magnus wrote: > Hi all, > > I have a login window with 2 fields (Login & Password) and an OK-Button. > The user would like to have the OK-Button pre-selected (marked with a > border or something) and when Enter is pressed the button will be > "pressed". > > I could add a listener on each text-field but is that the way to go > here? How do I get the border or other marking of the pre-selected button? > > Any and all help is much appreciated, > > Magnus
Technical Details
Message-ID:
<445b785a$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<445b7269$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,30e91bf2bfc69eae X-Google-Attributes: gid111d45,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Fri, 05 May 2006 12:07:44 -0400 From: Magnus <magnus_bjorkman@yahoo.com> User-Agent: Thunderbird 1.5.0.2 (Windows/20060308) MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing Subject: Re: Pre-Selected Button References: <445b7269$1@newsgroups.borland.com> In-Reply-To: <445b7269$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 69.69.78.174 Message-ID: <445b785a$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1146845274 69.69.78.174 (5 May 2006 09:07:54 -0700) Lines: 19 Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail