viewer.setLayout(layout);
// create a JComponent from the associated viewer
JComponent comp = viewer.getJComponent();
int tabIndex = tabbedPane.indexOfTab(tabLabel);
if (tabIndex < 0) {
// have to create a new tab
tabbedPane.addTab(tabLabel, tabIcon, comp);
tabIndex = tabbedPane.getTabCount() - 1;