Ok so I have been working on this for 12 hours straight and I cannot get it to work right to save my life. Attached is the word document of what the project is suppose to do and the file its suppose to read from.


* Filename: FinalProject.java
* Created: 3/1/2010 david ayres
* Purpose: calculates average, maximum, and minimum incomes using do...while and for loops

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.Toolkit;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.BufferedReader;
import java.util.Scanner;
import java.lang.String;

public class FinalProject extends JFrame
	//static variables to hold frame dimensions in pixels
	private static final int WIDTH = 480;
	private static final int HEIGHT = 550;

	//declare component objects
	private JLabel DateLabel, TNGasLabel, TDSalesLabel, GalRegGasLabel, GalEtLabel;
	private JTextField DateTextField, TNGasTextField, TDSalesTextField, GalRegGasTextField, GalEtTextField;
	private JButton CalcB, ClearB, CloseB;

	//declare event handlers
	private CalcButtonHandler cbHandler;
	private ClearButtonHandler clbHandler;
	private CloseButtonHandler exHandler;

	public FinalProject() //constructor that defines frame
		setTitle( "Gas Feeder System" ); //set the title of the frame
		setSize( WIDTH, HEIGHT ); //set the frame size

		Container pane = getContentPane(); //get content pane (a JFrame method)

		GridLayout aGrid = new GridLayout( 7, 2 ); //create a 5-row, 3-column layout

		pane.setLayout(aGrid); //set the layout for the pane

		//instantiate JLabel objects
		DateLabel = new JLabel( "Date File Created (mm-dd-yy):" );
		TNGasLabel = new JLabel( "Total Number of Gasoline Transactions:" );
		TDSalesLabel = new JLabel( "Total Dollars of ALL Sales:" );
		GalRegGasLabel = new JLabel( "Gallons of Regular Gasoline Sold:" );
		GalEtLabel = new JLabel( "Gallons of 10% Ethanol Gasoline Sold:" );

		//instantiate JTextField objects
		DateTextField = new JTextField( 5 );
		TNGasTextField = new JTextField( 5 );
		TDSalesTextField = new JTextField( 5 );
		GalRegGasTextField = new JTextField( 5 );
		GalEtTextField = new JTextField( 5 );

		//instantiate JButtons objects
		CalcB = new JButton( "Calculate");
		cbHandler = new CalcButtonHandler();
		CalcB.addActionListener( cbHandler );
		ClearB = new JButton( "Clear" );
		clbHandler = new ClearButtonHandler();
		ClearB.addActionListener( clbHandler );
		CloseB = new JButton( "Close" );
		exHandler = new CloseButtonHandler();
		CloseB.addActionListener( exHandler );

		//add objects to the pane
		pane.add( DateLabel );
		pane.add( DateTextField );
		pane.add( TNGasLabel );
		pane.add( TNGasTextField );
		pane.add( TDSalesLabel );
		pane.add( TDSalesTextField );
		pane.add( GalRegGasLabel );
		pane.add( GalRegGasTextField );
		pane.add( GalEtLabel );
		pane.add( GalEtTextField );
		pane.add( CalcB );
		pane.add( ClearB );
		pane.add( CloseB );


	}//end of constructor

	//inner clases for Button  Handler
	private class CalcButtonHandler implements ActionListener
		public void actionPerformed(ActionEvent e)
				File inFile = new File( "RAWTRANS.TXT" ); //locate data source

						FileReader aFileReader = new FileReader( inFile );//create pipeline
						//create valve
						BufferedReader aBR = new BufferedReader( aFileReader );
						RawData = aBR.readLine();//open valve
						String TotalDollarsAllSales = RawData.substring(12,6);
						String StockCode = RawData.substring(20,6);
			//			System.out.println("Reading File");

			catch(Exception el)
			//TotalGasTran = RawData.substring();

				//TDSalesTextField.setText( TotalDollarsAllSales );

		}//end actionPerformed
	}//end class Button Handler

	private class ClearButtonHandler implements ActionListener
			public void actionPerformed(ActionEvent e)
				//set text fields to empty strings
				DateTextField.setText( "" );
				TNGasTextField.setText( "" );
				TDSalesTextField.setText( "" );
				GalRegGasTextField.setText( "" );
				GalEtTextField.setText( "" );
			}//end actionPerformed
	}//end class Button Handler

		private class CloseButtonHandler implements ActionListener
				public void actionPerformed(ActionEvent e)
				}//end actionPerformed
		}//end class Button Handler

	public void centerFrame( int frameWidth, int frameHeight )
		//create Toolkit object
		Toolkit aToolkit = Toolkit.getDefaultToolkit();

		//Create a dimension object with user screen information
		Dimension screen = aToolkit.getScreenSize();

		//assign x, y position of upper-left corner of frame
		int xUpperLeftCorner = ( screen.width - frameWidth ) /2;
		int yUpperLeftCorner = ( screen.height - frameHeight ) /2;

		// method to position frame on user's screen
		setBounds(xUpperLeftCorner, yUpperLeftCorner, frameWidth, frameHeight);
	}// end frame

/* *****  COULD BE that your "throws FileNotFoundException, IOException" statement in the method
********  declaration for the main method is the thing causing the trouble.  You would not use it
********  IF you are encasing the the input/output statements within a try-catch-finally.  What does
********  it do?  Using these things in a potentially redundant manner will not gain anything.  Try
********  reorganizing it .........

	public static void main( String[] args) throws FileNotFoundException, IOException

		JFrame aFinalProject = new FinalProject();
		aFinalProject.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
		aFinalProject.setVisible( true );

	}//end main

}// end of public class extend FinalProject