🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.java.gui
2 messages
2 total messages Started by Burton Tjin Sat, 17 Mar 2001 03:53
How do I make a component receive focus?
#14
Author: Burton Tjin
Date: Sat, 17 Mar 2001 03:53
6 lines
1252 bytes
How do I make a JTextField receive focus as soon as my program starts? 
Will calling setFocus() in my class' constructor work ?

Thanks

Burton Tjin
Re: How do I make a component receive focus?
#15
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads