NAVO Java Workshop, September 25, 1998
A Java Applet with File I/O
This lab is based on the example
ShowData.html
Copy the files ShowData.html, ShowData.java, and datafile to your local disk.
- File I/O
Change this program so that for each data point, instead of just an x and
y value of the position of the point, there is an additional value that
represents a magnitude, which should be a single digit integer.
Hints:
- Change the datafile so that each line representing a data point has
an additional one digit integer.
- Change the program so that it reads this additional integer and
stores it into an array of magnitudes.
- Change the visualization of each point so that the size of the circle,
square and plus represent the magnitude. For example, you could draw the
circles of pixel size from 1 to 10 based on adding 1 to the magnitude.
- More Work with the AWT
Ideas:
- Add additional colors or shapes for the visualization.
- Add a checkbox for whether to draw a grid on the canvas or not.
- Add a checkbox to select the background color either black or white
(or a list to select from a number of background colors).
Nancy McCracken at the Northeast
Parallel Architectures Center.