Class TextIO_Miniquiz

java.lang.Object
  extended by TextIO_Miniquiz

public class TextIO_Miniquiz
extends java.lang.Object

Selecting a filename from a "save" dialog using class JFileChooser and writing to an output file using classes File and PrintWriter.

Version:
Copyright (c) 2013 -- SCCC West
Author:
You

Constructor Summary
TextIO_Miniquiz()
           
 
Method Summary
static void main(java.lang.String[] args)
          Writes name, age and phone number data to the file.
 
Methods inherited from class
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextIO_Miniquiz

public TextIO_Miniquiz()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Writes name, age and phone number data to the file. Instantiates object of class JFileChooser with "./App_Data" as default folder. Gets path and filename from showSaveDialog() method of class JFileChooser object. If the user clicks the 'Save' button get the path and filename from the JFileChooser object and assigns it the a new File object. Opens a new output PrintWriter file with the File object and writes the output the file.

Parameters:
args - the String[] array command line parameter
Throws:
java.io.IOException - if some sort of I/O exception has occurred