🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: GetFocus()

#8344
From: Terje Viken
Date: Fri, 22 Sep 2000 00:00
53 lines
1811 bytes
It's not clear what you want to do. If you wish to respond when a component
recieves focus - you have to implement a FocusListener and register it with
the component. Then you can respond to focus-lost and focus-gained messages.


   // Implement a listener class
   class MyFocusListener implements FocusListener
      public void focusLost(  java.awt.event.FocusEvent fe )
     {
        // Your lost focus code
      }

      public void focusGained( java.awt.event.FocusEvent fe )
     {
        // Your got-focus code
      }
    }

   // And when initializing - register your listener with your component
   yourComponent.addFocusListener( new MyFocusListener());


Terje Viken
Floroe, Norway


"Shane Stump" <ShaneStump@tanstaaflSoftware.com> wrote in message
news:39c35bc9$1_1@dnews...
> RequestFocus() sets the focus!
>
> Thanks,
>
> Shane
>
> "Ali Demir" <demir.4@osu.edu> wrote in message news:39c33836$1_1@dnews...
> > requestFocus() maybe?
> >
> >
> > "Shane Stump" <ShaneStump@tanstaaflSoftware.com> wrote in message
> > news:39c023b6$1_1@dnews...
> > > What is the equivalent JAVA api command for Windows GetFocus()
> function??
> > >
> > > Thanks,
> > >
> > > Shane
> > >
> > >
> >
> >
>
>
Technical Details
Message-ID: <8qft01$9f56@bornews.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <39c023b6$1_1@dnews> <39c33836$1_1@dnews> <39c35bc9$1_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,5fce9644c11175fd
X-Google-Attributes: gid111d45,public
From: "Terje Viken" <teviken@c2i.net>
Subject: Re: GetFocus()
Date: 2000/09/22
Message-ID: <8qft01$9f56@bornews.borland.com>
X-Deja-AN: 672893155
References: <39c023b6$1_1@dnews> <39c33836$1_1@dnews> <39c35bc9$1_1@dnews>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.5600
Organization: Another Netscape Collabra Server User
X-MSMail-Priority: Normal
Newsgroups: borland.public.jbuilder.java.swing