Programing patterns/ display gifs in java