1. add a timer to Swing in order to updating the direction by itselves.