I have two JTabbedPanes, JTabbedPane1 & 2 How can I press button in JTabbedPane2 to show JTabbedPane1 ?
Here is the code for JTabbedPane:
public cla
If you make the tabbed pane accessible to ButtonHandler you can do this:
class ButtonHandler implements ActionListener{
public void actionPerformed(ActionEvent e){
jtp.setSelectedIndex(0);
}
}
You can do this by making jtp (ideally with a better name) a private attribute with a getter method or it can be passed in as a constructor argument to ButtonHandler.