java - JavaFX: Task will not update UI -


I am working on the Omaha Online Poker client written in javaFX + java.

I need it control.call () After the execution is over, show an anchorpan with 3 buttons. I know that execution of control.call () ends but for some reason task.setOnSceeded (new event handler) { 's handle method not Update User Interface

What am I doing?

  Public Zero Neuround () {sog = StateOfGame.PREFLOP; ControlGameOnNewThread control = new ControlGameOnNewThread (); Task Task = New Action () {@Override protected Object call ()) Exception {control.call (); Return tap;}}; Work .Setonux (new event handler) {@Override Public Zero Handle (event event) {if (client.getAction () == FirstToact.me} {System.out.println ("Task Finished"); Showpans (clients .getToCall ()); Rival BETField.setText (new integer (opp.chipsInvested) .toString ()); MyBetField.setText (new integer (client.chipsInvested) .toString ()); System.out.println ("Task Finished");}}}); New thread (task) .start ();}    

The problem is that you are updating If you are in another thread and you want to update the user interface,

you need to call


  in the other thread. I Platform.RunLater (New Runnabal) {@Override Public Zero Run () {// Update UI Here}});   

This call will call the main thread and update all the necessary updates in the user interface

edit

  Public Zero Neuround () {sog = StateOfGame.PREFLOP; ControlGameOnNewThread Control = New ControlGameOnNewThread (); Task Function = New Work () {@Override Secure Object Call ()) Exception {control.call (); Return tap; }}; Task.setOnSceeded (New EventHandler) {@Override Public Nil Handle (Event Event) {If (client.getAction () == FirstTit.I) {Platform.RunLater (New Runnabel) {@Override Public Zero Run ({{System. Out.println ("Task Finished"); Showopresses (client.txt ()); Rival BETField.setText (new integer (opp.chipsInvested) .toString ()); myBetField.setText (new integer (client.chipsInvested) ToString ()); System.out.println ("Finished Work");}})}}}}); New thread (task). Start (); }    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -