Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```public void shake(){
- KeyFrame kf = new KeyFrame(Duration.seconds(1),
- new TimeHandler());
- Timeline timeline = new Timeline(kf);
- timeline.setCycleCount(3);
- timeline.play();
- }
- private class TimeHandler implements EventHandler<ActionEvent>{
- public void handle(ActionEvent event){
- ShakeLeft();
- ShakeRight();
- ShakeRight();
- ShakeLeft();
- }
- }```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement