code: public void setTabLocked(AbstractPanel panel, boolean lock) {
          for (int i = 0; i < this.getTabCount(); i++) {
          	Component tabCom = this.getTabComponentAt(i);
          	if (tabCom != null && tabCom instanceof TabbedPanelTab && tabCom.isVisible()) {
          		TabbedPanelTab jp = (TabbedPanelTab) tabCom;
          		if (panel.equals(jp.getAbstractPanel())) {
              		jp.setLocked(!lock);
          		}
          	}
          }
  	}
docs: Temporarily locks/unlocks the specified tab, eg if its active and mustn't be closed.
  <p>
  Locked (AbstractPanel) tabs will not have the pin/close tab buttons displayed.
  
  @param panel the panel being changed
  @param lock {@code true} if the panel should be locked, {@code false} otherwise.