When changing tabs, JTabbedPane always focuses the first focusable Component inside the tab.
How can I change its behaviour so that it will either focus the last focused component or none at all?
Invoking requestFocus afterwards is not an option because JTabbedPane must not set the focus in the wrong field at all.
When changing tabs, JTabbedPane always focuses the first focusable Component inside the tab. How
Share
Take a look at: Remembering last focused component.
You need to keep track of which component has focus in each tab. Then when a tab is selected, you need to change focus to the appropriate component. Here is the code taken from the link above: