private JButton createSaveButton()
  {
    JButton saveButton = new JButton("Save");

    saveButton.addActionListener(new ActionListener()
    {
      public void actionPerformed(ActionEvent e)
      {
        if (mDisplayArea.getText().equals(""))
        {
          JOptionPane.showMessageDialog(null, "No output to save",
              "Empty output", JOptionPane.ERROR_MESSAGE);
        }

        else
        {
          JFileChooser chooser = new JFileChooser();
          int returnVal = chooser.showSaveDialog(mPane);

          if (returnVal == JFileChooser.APPROVE_OPTION)
          {
            try
            {
              FileWriter writer = new FileWriter(chooser.getSelectedFile());
              writer.write(mDisplayArea.getText());
              writer.close();
            } catch (java.io.IOException ioErr)
            {
              JOptionPane.showMessageDialog(null,
                  "Encountered unknown error when saving output",
                  "Unable to save output", JOptionPane.ERROR_MESSAGE);
            }
          }

          else if (returnVal == JFileChooser.ERROR_OPTION)
          {
            JOptionPane.showMessageDialog(null,
                "Encountered unknown error when saving output",
                "Unable to save output", JOptionPane.ERROR_MESSAGE);
          }
        }
      }
    });

    return saveButton;
  }