for (int i=0; i<tabbedPane.getTabCount(); i++) {
BasePanel panel = (BasePanel)tabbedPane.getComponent(i);
map.put(tabbedPane.getTitleAt(i), panel);
}
tabbedPane.removeAll();
for (Iterator<String> i=map.keySet().iterator(); i.hasNext();) {
String title = i.next();
BasePanel panel = map.get(title);
tabbedPane.addTab(title, panel);
}