I have an application developed in netbeans and I want to set the focus to a certain jTextField when a panel is displayed. I have read a number of post and have
For me the easiest way to get it to work, is to put the component.requestFocus(); line, after the setVisible(true); line, at the bottom of your frame or panel constructor.
This probably has something to do with asking for the focus, after all components have been created, because creating a new component, after asking for the focus request, will make your component loose te focus, and make the focus go to your newly created component. At least, that's what I assume.