Hi ranchers, I want to let second component of the JFrame to be focused, but seems the requestFocus didn't work, my first component is the combobox, it gains the focus automatically, why I can not move the focus to the specific component
SCJP 1.4<br />SCWCD 1.3<br />SCJD<br />SCBCD<br />IBM Xml Cert in progress
What kind of Component is it? By default, some Components are not focusable, like labels, panes, etc. starting with Java 1.4. Also if the Component is not displayable, enabled, etc. it will not be focusable. If this does not help, try posting a snippet of code.
Zee Ho
Ranch Hand
Joined: Jul 20, 2004
Posts: 128
posted
0
In the UIUtils I just do very simple things to set some attribute to the JTextField
[ April 09, 2005: Message edited by: Zee Ho ]
Zee Ho
Ranch Hand
Joined: Jul 20, 2004
Posts: 128
posted
0
I request the focus on criteria_name which is a JTextField, but weird. it never gain it.
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
0
you were given the answer here >Also if the Component is not displayable, enabled, etc. it will not be focusable.
here's a compilable version of your code, to demonstrate