I create a new stream and from it I need to display the value of t1 in Label
public void Seconds(){ new Thread(() -> { finish.set(true); while (finish.get()){ a1++; t1 = Integer.toString(a1); Label.setText(t1); try { Thread.sleep(999); } catch (InterruptedException ex) { ex.printStackTrace(); } } }).start(); }
But instead of displaying values, I get an error that this is not possible. How, then, to display the required value on the screen? Via System.out.println (t1); everything is working.