[java] TabbedPane Tab Listener
Im working on an app which requires a tabbed pane. I began testing it quickly I realized my UI will need to know when a tab is clicked and which one.
I found I can add a ChangeListener into the JTabbedPane and it only gets fired when the tabs are changed. However I can not get any relevant information out of the ChangeEvent. So I have no idea which tab has been selected and that is what I need to keep track of. The state of the application is dependant on what tab the user is looking at.
Any advice?
Have you looked at JTabbedPane's getSelectedComponent() or getSelectedIndex()? They look as though they might help you out.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement