I'm making a JavaFX application. I have a label in main window. I have a method that generates random char from alphabet, but I would like to add some animation to it.
I mean spinning chars in a label during 2 seconds and then some random char appear. Animation is like in real slot machines.
I didn't find any library like that
How can I do that?
@FXML private Label answerID;
//generate random character and apply it to the label
private void generateChar() {
Random r = new Random();
String alphabet = "ABCDEFGHIKLMNOPQRSTUXYZ";
for (int i = 0; i < 25; i++) {
String text = "" + alphabet.charAt(r.nextInt(alphabet.length()));
answerID.setText(text);
}
}