import java.io.*;

import java.util.*;

/**

 * Insert the type's description here.

 * Creation date: (10/13/2004 2:50:28 PM)

 * @author: Ted Bowman

 */

public class SSMaker {

/**

 * SSMaker constructor comment.

 */

public SSMaker() {

            super();

}

/**

 * Starts the application.

 * @param args an array of command-line arguments

 */

public static void main(java.lang.String[] args)

{

    // Insert code to start the application here.

    WbPOI3 wb = new WbPOI3();

    WbPOI3 wbRead = new WbPOI3();

    String readRowVals[][];

    String rowVals[][] = new String[5][];

    rowVals[0] = new String[] { "Joe", "333-4545", "Friend", "Crazy" };

    rowVals[1] = new String[] { "Bob", "333-1111", "Friend", "Punctual" };

    rowVals[2] = new String[] { "Bill", "333-1234", "Foe", "Lazy" };

    rowVals[3] = new String[] { "Jill", "333-7878", "Unknown", "Smart" };

    rowVals[4] = new String[] { "Sally", "333-1111", "Foe", "Never Sleeps" };

    wb.setRows(rowVals, "People");

    wb.newSheet("People Down");

    wb.setCols(rowVals, "More");

    // add to same sheet

    wb.setRows(rowVals, "People");

    FileOutputStream f;

    try

    {

        f = new FileOutputStream("C:\\Temp\\people.xls");

 

    } catch (Exception e)

    {

        System.out.println("File could not be created");

        return;

    }

 

    wb.writeWB(f);

    try

    {

        f.close();

    } catch (Exception e)

    {

        System.out.println("File could not be closed");

        return;

    }

    wbRead.openFile("C:\\Temp\\people.xls");

    readRowVals = wbRead.getRows();

 

    int row, col;

    for (row = 0; row < readRowVals.length; row++)

    {

        for (col = 0; col < readRowVals[row].length; col++)

        {

            System.out.print(readRowVals[row][col] + ",");

 

        }

        System.out.print("\n");

    }

 

}

}
