void (TabbedPaneWrapper tabbedPane) { for (String tabName : myMainPanels.keySet()) { for (int i = 0; i < tabbedPane.getTabCount(); i++) { if (tabName.equals(tabbedPane.getTitleAt(i))) { tabbedPane.removeTabAt(i); break; } } } }