Article View: borland.public.jbuilder.java.language
Article #18506Setting initial focus to a JTextField
From: Anne Ritchie
Date: Mon, 15 Jun 1998 00:00
Date: Mon, 15 Jun 1998 00:00
17 lines
909 bytes
909 bytes
I am trying to set a textfield to have immediate focus upon entry of a
screen by using the following in the init:
jTextField1.setRequestFocusEnabled(true);
jTextField1.requestFocus();
The focus seems to be on the JFrame itself and until a tab key is entered,
it won't give relinquish the focus to the textfield, regardless of the above
code.
Anybody resolved this one?
TIA
Anne Ritchie
aritchie@oriental.com
Technical Details
Message-ID:
<6m3er6$3rj5@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,4281a01fd744281c,start X-Google-Attributes: gidf74b3,public From: "Anne Ritchie" <aritchie@oriental.com> Subject: Setting initial focus to a JTextField Date: 1998/06/15 Message-ID: <6m3er6$3rj5@forums.borland.com> X-Deja-AN: 362852542 X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4 Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.language