code: public void setContent(Component newContent) {
          Component oldContent = getContent();
          if (hasContent()) {
              remove(oldContent);
          }
          add(newContent, BorderLayout.CENTER);
          firePropertyChange("content", oldContent, newContent);
      }
docs: Sets a new panel content; replaces any existing content, if existing.
  
  @param newContent
  the panel's new content