🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Set focus to a component

#12234
From: Michael H�rtig
Date: Tue, 02 Feb 1999 00:00
39 lines
1291 bytes
You have to call this method in another thread. Then it works.

   new Thread("Thread"){
         public void run(){
            try{
               sleep(100); //test the value for yourself
               jTextField1.requestFocus();
            }
            catch(Exception e){}
         }
      }.start();

Michael

Achim Luetje schrieb:

> Hallo all,
>
> I want to set the focus to a special  component, e. g. a JTextField, in
> a JFrame or JDialog in an Applet.
>
> I try the method
>
> jTextField1.requestFocus();
>
> but it don't work.
>
> Thanks for help
>
> Achim
>
> --
> Achim L�tje
> PPI Informationssysteme GmbH
> Graumannsweg 54
> D-22087 Hamburg
> Tel.: +49(40)22743349
> Fax:  +49(40)22743333
> Mailto:al@ppi.de
Technical Details
Message-ID: <36B71E8F.1E4C1343@nupis.de>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <36B54737.9E5C3006@ppi.de>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 111d45,1cfa813af9a956ed
X-Google-Attributes: gid111d45,public
From: "Michael H�rtig" <haertig@nupis.de>
Subject: Re: Set focus to a component
Date: 1999/02/02
Message-ID: <36B71E8F.1E4C1343@nupis.de>
X-Deja-AN: 439786844
Content-Transfer-Encoding: 8bit
References: <36B54737.9E5C3006@ppi.de>
Content-Type: text/plain; charset=iso-8859-1
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing