/* * TextFileAccessor.java * * This program reads back the file created by TextFileMaker.java.  See * that program for a description of the file * * Copyright (c) 2000 - Russell C. Bjork * */import java.io.*;import javax.swing.*;public class TextFileAccessor{    public static void main(String [] args) throws IOException    {        // Open the file        		File filename;		JFileChooser chooser = new JFileChooser(System.getProperty("user.dir"));		if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION)		{			filename = chooser.getSelectedFile();		}		else			return;			        BufferedReader input = new BufferedReader(new FileReader(filename));                // Read the values from the file                boolean booleanValue = (new Boolean(input.readLine())).booleanValue();        char charValue = input.readLine().charAt(0);        byte byteValue = (new Byte(input.readLine())).byteValue();        short shortValue = (new Short(input.readLine())).shortValue();        int intValue = (new Integer(input.readLine())).intValue();        long longValue = (new Long(input.readLine())).longValue();        float floatValue = (new Float(input.readLine())).floatValue();        double doubleValue = (new Double(input.readLine())).doubleValue();        String stringValue = input.readLine();        		// Write out what we read				System.out.println(booleanValue);		System.out.println(charValue);		System.out.println(byteValue);		System.out.println(shortValue);		System.out.println(intValue);		System.out.println(longValue);		System.out.println(floatValue);		System.out.println(doubleValue);		System.out.println(stringValue);		        // Close the file and we're done                input.close();        System.exit(0);    }}        