🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #15152

Re: How to pre-set focus?

#15152
From: peterbl
Date: Thu, 01 Jul 1999 00:00
23 lines
1195 bytes
or another way would be:
    SwingUtilities.invokeLater(new Runnable(){
        public void run(){
            yourComponent.requestFocus();
        }
    });
Peter.

Greg Hamer wrote:

> requestFocus(). You may have to wait until the Frames addNotify()
> happens for it to work. Just override addNotify(), by calling
> super.addNotify(), then textField.requestFocus();
>
> Vladimir D Bondarenko wrote:
>
> > Hi there,
> >
> > I have a textField in a Panel added to a Frame.
> > How can I ensure the textField has  focus on application start?
> > (hands-off TAB key :-)).
> >
> >  Thanks in advance
Technical Details
Message-ID: <377B796F.59AA8C6F@home.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <375D1261.5E9AE215@azot.com.by> <375E8988.BFF1EEEA@borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,62eb93edf71a58c8
X-Google-Attributes: gidf74b3,public
From: peterbl <peterbl@home.com>
Subject: Re: How to pre-set focus?
Date: 1999/07/01
Message-ID: <377B796F.59AA8C6F@home.com>
X-Deja-AN: 496025525
Content-Transfer-Encoding: 7bit
References: <375D1261.5E9AE215@azot.com.by> <375E8988.BFF1EEEA@borland.com>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language