public boolean isServiceSelected(){
  return tabbedPane != null && tabbedPane.getSelectedComponent() != null && tabbedPane.getSelectedComponent() instanceof ServicePanel;
}

public boolean isServiceSelected ( ) { return tabbedPane != null && tabbedPane . getSelectedComponent ( ) != null && tabbedPane . getSelectedComponent ( ) instanceof ServicePanel ; }
is the currently selected panel a service panel ?
