Article View: borland.public.jbuilder.java.swing
Article #8023How to set the focus on a control ?
From: Thomas Bednarz
Date: Wed, 08 Nov 2000 00:00
Date: Wed, 08 Nov 2000 00:00
16 lines
1474 bytes
1474 bytes
How can I set the focus on a control? I have a dialog which has as first control a NON-EDITABLE text field. This field is allways highlited and has the focus when the dialog is displayed. Next is a combo box which SHOULD have the focus and the first item should be selected. I tried the following function calls but none of them where successful: MyCombo.requestFocus(); MyCombo.requestDefaultFocus(); Do I need to call something else after calling one of the above functions? Users are about to kill me, because they always have to hit the tab key before they can start their selection in the combobox. Any help would be greatly appreciated! Thomas
Technical Details
Message-ID:
<3A0952C7.605063AD@bluewin.ch>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,e40a22670d2d438d,start X-Google-Attributes: gid111d45,public X-Google-Thread: 10fd6d,e40a22670d2d438d,start X-Google-Attributes: gid10fd6d,public From: Thomas Bednarz <tkmb@bluewin.ch> Subject: How to set the focus on a control ? Date: 2000/11/08 Message-ID: <3A0952C7.605063AD@bluewin.ch> X-Deja-AN: 691187674 Content-Transfer-Encoding: 7bit X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: news@ip-plus.net X-Trace: pollux.ip-plus.net 973689322 6990 194.209.84.67 (8 Nov 2000 13:15:22 GMT) Organization: Swisscom IP+ (post doesn't reflect views of Swisscom) Mime-Version: 1.0 NNTP-Posting-Date: 8 Nov 2000 13:15:22 GMT Newsgroups: borland.public.jbuilder.java.swing,comp.lang.java.gui