private void loadFile()
    {
        File inFile = new File("C:");
        DataInputStream iStream;
        JFileChooser fileChooser = new JFileChooser(inFile);
        
        //Terminate the method early if the user does not pick a file.
        if(fileChooser.showOpenDialog(null) != JFileChooser.APPROVE_OPTION)
        {
            return;
        }
        
        clear();
        
        inFile = fileChooser.getSelectedFile();

        try
        {
            iStream = new DataInputStream(new FileInputStream(inFile));

            //First the program counter is read
            cpu.setPCValue(iStream.readInt());

            //Second the input cards are read
            for(int count = 0; count < inputCards.registers.length; count++)
            {
                inputCards.registers[count].setValue(iStream.readInt());
            }

            //Third the memory register values are read
            for(int count = 1; count < memory.registers.length; count++)
            {
                memory.registers[count].setValue(iStream.readInt());
            }
        }
        catch(IOException ex)
        {
            JOptionPane.showMessageDialog(null, 
                                     "There was an error loading the program.");
        }
    }