-1

I have a "starter tab" at index 0 of my tabbed pane. The user can create a multitude of tabs and remove them as needed. They can also remove all. However, this removes index 0 as well. What does the function look like that removes all tabs except zero?

dbank
  • 1,173
  • 1
  • 17
  • 29
KiloJKilo
  • 465
  • 1
  • 6
  • 16

1 Answers1

2

How about

while (tabbedPane.getTabCount() > 1) {
    tabbedPane.remove(1);
}
James_D
  • 201,275
  • 16
  • 291
  • 322