Handouts:
ArrayLists
Examples:
Rockets
Day7: StarWars.java
Write a program that reads in a text file and animates the lines together from the bottom to the top of the screen, similar to the movie Star Wars.
This graphics program can be modeled by imagining each line of the text file as a single GLabel. We want to put all of these GLabels on the screen, and then animate them up the screen all at the same time. Try approaching the following steps to do this:
setSize
to resize it)TEXT_FILENAME
using readFile
, which takes a filename as a parameter and returns an ArrayList of the lines in the file. Like this:
ArrayList<String> lines = readFile("myfile.txt");
LABEL_PADDING
further down.""
) which is fine. This will add spacing.