Пример #1
0
  protected void deleteCurrentPanel() {
    JComponent tabPane = (JComponent) tabbedPane.getSelectedComponent();
    if (tabPane == null) return;

    WMSPanel wmsPanel = (WMSPanel) tabPane.getClientProperty(Constants.FEATURE_OWNER_PROPERTY);

    if (tabbedPane.getTabCount()
        > 2) // actually remove the tab only if there is more than one (plus the "+" tab)
    tabbedPane.remove(tabPane);
    else tabbedPane.setTitleAt(1, "New Server");

    if (wmsPanel != null) wmsPanel.clearPanel();
  }