Hello guys,
There is a thing I need help with. When I run my program, and the window shows, I want focus on the textField. Like Google, when you enter Google, you get focus on the search panel so you can search. My program got a simple search engine with a textField which I want focus on.
My program consists of tabs. This is an example for how I use it.
Main.java
Frame.java (extends JFrame). Here I add the tabs
Tab1.java (extends JPanel). This class contains the search engine, and I want to focus on the textfield.
I have tried:
textField.requestFocus(); on my Tab1.java file, but it won't get focused.
So I need some help from you. How should I do this?