wood burning stoves*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Request Focus Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Request Focus" Watch "Request Focus" New topic
Author

Request Focus

Nagu Rathina
Ranch Hand

Joined: Jun 17, 2002
Posts: 31
Friends,
In a dialog, I have a text field. I want to have focus in it, whenever the dialog shows. should I have jtxtseat.requesFocus() called before showing or after showing?
sometimes even if the cursor blinks, I am not able to type data w/o clicking on the field once. why is it so?
Help me.
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Nagu,
Supply some more info or maybe even some code so we can give you an opinion. Is the dialog modal? Is it regenerated or reused?
Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

I would think after show is where you want to call requestFocus().
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Request Focus
 
Similar Threads
showInputDialog( ) focus
Problem with keystrokes and JOptionPane
Dialog modality problem
Setting initial focus in a Model JDialog
problem with JDialog (urgent) please help