🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.java.gui
Article #15

Re: How do I make a component receive focus?

#15
From: Babu Kalakrishnan
Date: Sat, 17 Mar 2001 06:59
9 lines
1330 bytes
On Sat, 17 Mar 2001 03:53:29 GMT, Burton Tjin <burtontjin@yahoo.com.DoNotSpam> wrote:
>How do I make a JTextField receive focus as soon as my program starts? 
>Will calling setFocus() in my class' constructor work ?

Caling anything in the constructor is unlikely to work. Try installing a
WindowListener to your main GUI frame and calling
yourtextfield.requestFocus() in the WindowOpened event handler.

BK
Technical Details
Message-ID: <slrn9b62qe.356.kala@ganga.sankya.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!news-feed.riddles.org.uk!news.litech.org!lnsnews.lns.cornell.edu!newsstand.cit.cornell.edu!news.stealth.net!192.169.41.193.MISMATCH!newsserver.pacific.net.sg!kala
References: <3AB2DF77.F0088B71@yahoo.com.DoNotSpam>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10fd6d,193331a5abdaa0a6
X-Google-Attributes: gid10fd6d,public
X-Google-Thread: fbe9c,193331a5abdaa0a6
X-Google-Attributes: gidfbe9c,public
X-Google-ArrivalTime: 2001-03-16 23:12:07 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!news-feed.riddles.org.uk!news.litech.org!lnsnews.lns.cornell.edu!newsstand.cit.cornell.edu!news.stealth.net!192.169.41.193.MISMATCH!newsserver.pacific.net.sg!kala
From: kala@sankya.com (Babu Kalakrishnan)
Newsgroups: comp.lang.java.gui,borland.public.jbuilder.java
Subject: Re: How do I make a component receive focus?
Date: Sat, 17 Mar 2001 12:29:26 +0530
Organization: Subscriber of Pacific Internet 
Lines: 9
Message-ID: <slrn9b62qe.356.kala@ganga.sankya.com>
References: <3AB2DF77.F0088B71@yahoo.com.DoNotSpam>
NNTP-Posting-Host: ppp65.bangalore-188.pacific.net.in
User-Agent: slrn/0.9.6.2 (Linux)