   import java.io.*;

/**
 * A driver for testing the TableWriter class
 */
   public class Driver
   {
    /**
     * The entry point
     *
     * @param args   The command-line arguments
     */
      public static void main(String[] args)
      {
         PrintWriter          printWriter;
         String[][]           table = {
                                      {"DJIA","10,487.11","+16.52","+0.16%"},
                  							{"NASDAQ","2,060.94","+3.52","+0.18%"},
                  							{"S&P 500","1,142.76","+0.95","+0.08%"},
               								{"10-Yr TR.","4.20%","+0.06"}};
         TableWriter          out;
      
         printWriter = new PrintWriter(System.out, true);
         out = new TableWriter(printWriter);
         out.setFieldWidth(10);
      
      	System.out.println("Print Table\n");
         out.printTable(table);
         System.out.println("\n\nWrite Table\n");
         out.writeTable(table);
         System.out.println("\n\nPrint Table With Headers\n");
         out.printTableWithHeaders(table);
     
      }
   }
