/**
   * Set the current panel
   *
   * @param panel the panel
   */
  protected void setCurrentPanel(WizardPanel panel) {

    currentPanel = panel;
    currentPanel.prepare();

    cardLayout.show(cardPanel, currentPanel.toString());

    backButton.setEnabled(currentPanel != firstPanel);
    cancelButton.setText("Cancel");
    nextButton.setText("Next");
    cancelButton.setEnabled(true);
  }
  /**
   * Register a wizard panel
   *
   * @param id the panel ID
   * @param panel the panel
   */
  protected void registerWizardPanel(Object id, WizardPanel panel) {

    panel.key = id;
    panel.wizard = this;

    panels.add(panel);
    panelMap.put(id, panel);

    cardPanel.add(panel.getPanel(), panel.toString());

    if (firstPanel == null) {
      firstPanel = panel;
      currentPanel = panel;
      setCurrentPanel(panel);
      pack();
    }
  }