Hello java folks. Could someone please help me? I want to run some code when a user clicks a tab in a tabbed pane. Do I have to add a listner to the tabbed pane? If so, can someone give me code snippet example. Then how do I run a method when the click occurs. -Juan Matos
Implement in a class the javax.swing.event.ChangeListener interface and add an instance of that class to the tabbed pane's change listeners. To implement the interface you'll have to implement the stateChanged( ChangeEvent event ) method where you can react to the user's action.
Thank you so much Sascha. I have just read your post reply but haven't tried it. I'll be able to try the code tommorow but wanted to let you know how much I appreciate your help right now. Thanks a million. -Juan