private void saveFile()
    {
        File outFile = new File("C:");
        DataOutputStream oStream;
        JFileChooser fileChooser = new JFileChooser(outFile);
        
        //Terminate the method early if the user does not pick a file.
        if(fileChooser.showOpenDialog(null) != JFileChooser.APPROVE_OPTION)
        {
            return;
        }
        
        //If the specified file already exists, it will be deleted.
        outFile = fileChooser.getSelectedFile();
        outFile.delete();

        try
        {
            oStream = new DataOutputStream(new FileOutputStream(outFile));

            //First the Program Counter is stored.
            oStream.writeInt(cpu.getPCValue());

            //Second the input cards are stored.
            for(int count = 0; count < inputCards.registers.length; count++)
            {
                oStream.writeInt(inputCards.registers[count].getValue());
            }

            //Third the memory register values are stored starting at 01.
            for(int count = 1; count < memory.registers.length; count++)
            {
                oStream.writeInt(memory.registers[count].getValue());
            }

            oStream.close();
        }
        catch(IOException ex)
        {
            JOptionPane.showMessageDialog(null, 
                                      "There was an error saving the program.");
        }
    }