1

I have created a java application which has a JTabbedPane that contains three JPanels. In my first panel I have a button. When the user clicks the button, it should open/show the second panel. Can anyone tell me how I can do that?

mort
  • 12,988
  • 14
  • 52
  • 97
Sas
  • 2,473
  • 6
  • 30
  • 47

1 Answers1

1

Simply use the method setSelectedIndex

myTabbedPane.setSelectedIndex(1);
mort
  • 12,988
  • 14
  • 52
  • 97
  • Yes I did. You know, I have to wait 5minutes before accepting the answer. Anyways Thanks man. – Sas Nov 27 '11 at 20:17