Did you just have a while(true) loop going in your Shifty class?
No. The act method has the keystroke detection and calls a method called 'shift' with the direction. The 'shift' method has a double-'for' loop -- the outer loop for the four axes of movement and the other for getting the tiles along each axis and moving them. Also a local field is declared before the inner 'for' loop to track the number of tiles found along the second axis (so the new tile positions can be easily determined).