java - Reset the text on a button in Javafx through the use of a task continously -
alright, need able reset text of button or label in javafx continuously. had assumed correct plan of action use concurrency package , use task. i'm making idle game , 1 last thing need figure out how before can cracking away @ update currency without having click button. value currency updated on own , know part works need show on gui. @ moment task looks this...
task task = new task<void>() { @override public void call() { while (true) { update(m, this); // updates text fields buttons } } } };
i'm getting bunch of string errors point each of settext lines in update method.
@override protected void call() throws exception { updatemessage("execution starts"); //your code updatemessage("execution completed"); }
you might use button
's textproperty() method bind message task updates. this.
button.textproperty().bind(task.messageproperty());
i hope helps.
Comments
Post a Comment