问题
Is it possible to put an actionlistener on a tab in swing? If it is please could you post a small example?
回答1:
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...
来源:https://stackoverflow.com/questions/4443559/java-actionlistener-on-a-tab