The Artima Developer Community
Sponsored Link

Java Answers Forum
AWT Event Focus Listener

1 reply on 1 page. Most recent reply: Aug 19, 2002 1:50 AM by Javed

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
shakil siddque

Posts: 2
Nickname: shakil
Registered: Aug, 2002

AWT Event Focus Listener Posted: Aug 18, 2002 12:26 AM
Reply to this message Reply
Advertisement
I have an applet in a document, which captures all Keyboard strokes with AWT.EVENTS, Swing is not used. But, when the Focus is lost, listener can tell me that the applet has lost its focus. I need to gain back default focus on the applet again, on the event of "focusLost". Now the problem is, I cannot gain back in AWT. Or maybe I simply don't know !

Is there anyone who can help me, gaining my default focus again ?

Thanx in Advance ........


Javed

Posts: 15
Nickname: javedm
Registered: Aug, 2002

Re: AWT Event Focus Listener Posted: Aug 19, 2002 1:50 AM
Reply to this message Reply
Hi,

requestFocus() gets the focus to a desired component.

Say I have a textfield

TextField tf = new TextField();
tf.requestFocus();

This gets the focus onto the textfield.

Flat View: This topic has 1 reply on 1 page
Topic: ned hlp set envionmnet Previous Topic   Next Topic Topic: cancelling a remote RMI call

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use