java actionlistener on a tab

后端 未结 1 1824
挽巷
挽巷 2021-01-21 14:48

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

相关标签:
1条回答
  • 2021-01-21 15:08

    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...

    0 讨论(0)
提交回复
热议问题