What listener should I add to JTabbedPane, so I can "follow": opening new tab, closing tab, and changing selected tab?
The quieter you are, the more you are able to hear.
posted 6 years ago
If you add a ChangeListener to the JTabbedPane's SingleSelectionModel (obtained via getModel()), you can listen for selection changes. I think that to listen for addition and removal of tabs / components, you'll want to add a ComponentListener to the JTabbedPane, though I'm not 100% sure if this is the only or best way to do this.