I want to show an image or a text in a label just for few seconds and then it disappear . Something like this :
lable.setText("data inserted");
//wait two second
lable.setText(null);
I want to show an image or a text in a label just for few seconds and then it disappear . Something like this :
lable.setText("data inserted");
//wait two second
lable.setText(null);
You can use a PauseTransition
:
lable.setText("data inserted");
PauseTransition pause = new PauseTransition(Duration.seconds(2));
pause.setOnFinished(e -> lable.setText(null));
pause.play();