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:

  1. Add the background image (hint: use setSize to resize it)
  2. Read in the text file 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");
  3. Place the labels bellow the screen. The first label should initially be LABEL_PADDING pixels bellow the screen, and each label should be LABEL_PADDING further down.
  4. Some Strings are empty ("") which is fine. This will add spacing.
  5. Animate the labels onscreen by moving all the labels up a small amount, then pausing, and then repeating.


  1. As a first step, load the ArrayList of lines from the file (test that this works)
  2. Make a GLabel for each line and place it in its initial position. You can pull the bottom corner of your graphics window to change the size of the screen and look for objects. Here is a figure of the initial position of the GLabels:
  3. Animate the GLabels
  4. Add a background and change the labels to be white