I use Vaadin 10.0.1. When I change components from button click event it changes them simultaneously. I need to change them one by one.
See the example:
countButton.addClickListener(buttonClickEvent -> {
int input = Integer.parseInt(inputTextField.getValue());
long factorialResult = countFactorial(input);
resultFactorialLabel.setText("Factorial: " + factorialResult);
try {
sleep(1000); //just for example, could be some really long processing
} catch (InterruptedException ignored) {
}
int fibonacciResult = countFibonacci(input);
resultFibonacciLabel.setText("Fibonacci: " + fibonacciResult);
});
Here 10 seconds passes, then resultFactorialLabel and resultFibonacciLabel change simultaneously, when I want resultFactorialLabel to be changed and after that, in 10 seconds resultFibonacciLabel to be changed. How can I do it?