Question

Is it possible to put an actionlistener on a tab in swing? If it is please could you post a small example?

Was it helpful?

Solution

The only way to do that is to add a javax.swing.event.ChangeListener to the JTabbedPane itself. You might have to keep track of the selected tab vs. previously selected tab depending on what you are doing with the state change...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top