Java: animated progress bar snippet