I've tried setSelectedIndex(), which, according the API, SHOULD work, but it's still staying where it was. In a tabbed pane with lots of tabs, this is sure to tick off users if it doesn't auto-scroll to a newly added tab at the end.
However, the issue appears to be within the API itself I've heard. Does anyone know of a platform-independent fix?
I've tried SwingUtilities.runLater and I've tried setSelectedIndex(). I also tried setSelectedTabComponent(), which kept throwing an exception saying its not visible or not in the tabbed pane or something stupid.
I'm really upset and wanna
Does anyone know a way around this glitch? So far, I can find nothing online that works. (And, I think I may have found one, but it's platform specific, meaning, it may work on one OS but not another, which isn't what I want.)
I thought it must be the API itself. I was right. http://bugs.sun.com/view_bug.do?bug_id=6285072. So, other than using a practically pathetic tab pane, what else can I do to get around this crippling glitch?
Ok, that might not be my issue. The issue isn't that it's not showing the component, it IS showing the component, the thing is, even if the tab is selected, the poor user has to scroll to the end if a new tab is added, which, if they're at the beginning in the view, is a pain in the you-know-what.
However, the issue still appears to be the API itself.
I've also tried
javax.swing.Action action = tabPane.getActionMap().get("navigateNext");
action.actionPerformed(new ActionEvent(tabPane, ActionEvent.ACTION_PERFORMED, "Unnamed") );
Even that, which can't work in every case as tab names my vary depending on whether it's a tabbed addressbook or a tabbed notepad, and it won't work even in this specific case either.
I found another oracle issue related to the bug here, but the page has a hard time opening.