private void clearSensorPanel(){
  if (currentSensorPanel != null) {
    mainPanel.remove(currentSensorPanel);
  }
}

private void clearSensorPanel ( ) { if ( currentSensorPanel != null ) { mainPanel . remove ( currentSensorPanel ) ; } }
remove current panel , if any .
