From what I checked in the JTabbedPane sources, the fireStateChanged()
method triggers a focus change event if necessary, before firing the actual "stateChanged" event to the listeners.
So in theory, it should happen before. However, since I don't know what is happening in the called method (SwingUtilities2.tabbedPaneChangeFocusTo(newComp)
), it's highly possible that the event goes into another thread, being related to focus management.
The fireStateChanged()
is a protected method, so you could override it in your own JTabbedPane, and make sure the behavior is the one you want.
Give more details about your actual use case, to see if there can be a more appropriate solution.