I don't see how to see how to set the initial focus of a JTextField in a JFrame after the JFrame loads. I want to have focus already be inside the first text field. There should be an easy way to set the initial focus, but I haven't found it. This would be analogous to setting the "Tab-Order" in Microsoft products. I've tried things like: jTextField.setFocusCycleRoot(true); TextField.requestFocus(); But nothing works. Any ideas? Thanks. -- Mike
The trick to it is to requestFocus() AFTER you have setVisible to true, not before. It seems to be negated if you setVisible to true after you request focus.
Mike London
Ranch Hand
Joined: Jul 12, 2002
Posts: 949
posted
0
Yes, using WindowAdaptor worked. Thank you!!! -- Mike