0
0,5 초마다 레이블에 점을 추가하고 싶지만 3 개의 점이있는 경우 3 초 동안 프로세스를 일시 중지 한 다음 점을 제거하고 다시 시작합니다 (3 번). 제거 일시 정지하지 아니,이 방법을 사용하여 시도,하지만 그것은 단지 추가 : 당신은 할 수프로세스의 타임 라인 일시 중지
Label calling = new Label("Calling");
Timeline timer = new Timeline();
KeyFrame first = new KeyFrame(
Duration.millis(500),
a -> {
calling.setText(calling.getText()+".");
if(calling.getText().endsWith("...")){
new Timeline(new KeyFrame(Duration.seconds(3), b-> calling.setText("Calling"))).play();
}
}
);
timer.getKeyFrames().addAll(first);
timer.setCycleCount(9);
timer.play();
});