Article View: borland.public.jbuilder.java.swing
Article #10211Re: Getting focus in a JTextField
From: Paul Furbacher [TeamB]
Date: Wed, 27 Oct 1999 00:00
Date: Wed, 27 Oct 1999 00:00
16 lines
1232 bytes
1232 bytes
Leo Cohen wrote: > I start up an application by soliciting a line of text information from > the user. I do this with JDialog and JTextField. The control comes up > just after I have put a menu on the screen. > > The problem is that the user has to move the mouse over the control in > order to get focus. I've tried putting jTextField.requestFocus() before > and after the jTextField.setVisible(true), but to no avail. Typically, focus requests are only honored for "realized" components. You can look at how JOptionDialog works around this when it sets the focus before showing itself and mimic that. Paul Furbacher (TeamB)
Technical Details
Message-ID:
<38173F6D.5BCBD6AB@bilbo.bio.purdue.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<38161920.4814F842@cs.virginia.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,35281d36553f78f1 X-Google-Attributes: gid111d45,public From: "Paul Furbacher [TeamB]" <pf@bilbo.bio.purdue.edu> Subject: Re: Getting focus in a JTextField Date: 1999/10/27 Message-ID: <38173F6D.5BCBD6AB@bilbo.bio.purdue.edu> X-Deja-AN: 541294078 Content-Transfer-Encoding: 7bit References: <38161920.4814F842@cs.virginia.edu> Content-Type: text/plain; charset=us-ascii Organization: Reverse Alchemy, Inc. Mime-Version: 1.0 Reply-To: pf@bilbo.bio.purdue.edu Newsgroups: borland.public.jbuilder.java.swing