private void outputFileBtnPress()
	{
		JFileChooser fc = new JFileChooser();
		int returnVal = fc.showOpenDialog(TrainView.this);
        if (returnVal == JFileChooser.APPROVE_OPTION)
        {
            outputFile = fc.getSelectedFile();
            outputLbl.setText(outputFile.getName());
        }
        
        //This is where the work begins

        BufferedReader br1,br2;
        String line1,line2,fLine;
        FileWriter fw;
        char tempChar;
        
        //fw.write("add a line\n");

		try 
		{
			br1 = new BufferedReader(new FileReader(plainTextFile));
			fw = new FileWriter(outputFile,true); 
			int count = 0;
			while ((line1 = br1.readLine()) != null)
			{
				//for each line of plain text do the following
				// Encipher the data using 
				// all 26 mono shifts
				// all poly keywords
				// write the line to the output file.
				count++;
				System.out.println("Processing line: " + count);
				
				fLine = "";
				//filter the line.
				for (int i = 0; i < line1.length();i++)
				{
					tempChar = line1.toUpperCase().charAt(i);
					if( ('A' <= tempChar) && (tempChar <= 'Z'))
						fLine+=tempChar;
				}
				
				//Plain text
				fw.write(fLine + ":0\n");
				
				//Mono shifts
				for (int i =1; i<26; i++)
				{
					fw.write(CryptoNet.monoShift(fLine, i)+":1\n");				
				}
				
				//Poly codes
				br2 = new BufferedReader(new FileReader(polyKeywordFile));
				while ((line2 = br2.readLine()) != null)
				{
					fw.write(CryptoNet.polyEncrypt(fLine,line2) +":2\n");
				}
				br2.close();
			}
			br1.close();
			fw.close();
		} //end try
		catch (FileNotFoundException e) 
		{
			e.printStackTrace();
		}
		catch (IOException e)
		{
			e.printStackTrace();
		}
        
		System.out.println("done");
	}