Title: Graphing Problem
Course: CPS 261: Advanced Java Concepts ~ DL & MM MASTER

Graphing Problem

At the end of the Notes/Video for "Drawing Sizing", you will see the beginnings of a graphing program. I want you to modify it to generate an output that looks something like:

The data for this graph should come from reading the following file.

graphing.txt file

Notes

1. The red border around the graph is 10 pixels in width. I would recommend that you make this width a parameter by declaring a variable like:
int myBorder=10;
2. The first line of the file contains the title for the Graph. Subsequent lines contain the data. A ";" separates the String name from the integer data.
3. You can set the title of your JFrame based application by calling:
setTitle("New Title");
4. I would recommend that you change the starter code so that the constructor to the Graphing class is passed the name of the file. Let your Graphing class read in the file. It would be good to put this file reading routine in a separate method.
5. The strings read in from the file will probably need to be trimmed. Remember that Integer.parseInt is real picky if you use it to convert a string to an integer.

Last Updated: June 15, 2014 3:15 PM