Adding Tabs to JTabbedPane
Hello! I'm mildly new at Java. I've been using it for a little over a year now, but I just started learning the GUI stuff. I'm experimenting with JTabbedPane at the moment. I'm trying to add a new tab to my JTabbedPane if the user clicks a certain button. I have the tab adding perfectly fine, but my question is this: Is it possible for me to bring the tab to the front as soon as it is added? If there are several other tabs already in the pane, I want the new tab to show up in front immediately, without the user having to go and click on the tab.
I was looking at the Java API and found quite a few methods pertaining to focus, but I didn't really understand it. Is this what I need to use? Or is there something else?
Thank you in advance!