Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. ```public void shake(){
  2. KeyFrame kf = new KeyFrame(Duration.seconds(1),
  3. new TimeHandler());
  4. Timeline timeline = new Timeline(kf);
  5. timeline.setCycleCount(3);
  6. timeline.play();
  7. }
  8.  
  9. private class TimeHandler implements EventHandler<ActionEvent>{
  10. public void handle(ActionEvent event){
  11. ShakeLeft();
  12. ShakeRight();
  13. ShakeRight();
  14. ShakeLeft();
  15.  
  16. }
  17. }```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement