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 tried various methods but non have worked. One of the main issues is where to place the required code, which I believe in my case is this.txtMessage.requestFocusInWindow();
There are some posts that indicate using a Window Listener, however as netbeans has generated the GUI, I cannot see how to implement the interfaces as I cannot edit the code that creates the jPANEL etc. The whole thing is very frustrating and I really do not believe that this should be that difficult.
Just as a test I added the requestFocusInWindow();
to a button on the panel and it did set the focus to the desired input.