It is necessary that the client is constantly in standby mode of entering commands from the user. These commands are then sent to the server .
Found many examples of client-server communication (Java).
For example this: The simplest client-server application
In this example, the client is waiting for input from the console. How do I wait for input from a control component, such as TextField (JavaFX)?
There is an idea, to save the text from TextField in a certain variable. The client will check this variable for changes once a second. When changing, send a string to the server .
Or handle the ActionEvent event for TextField . Is it possible to determine in the client the function that will receive the string and send it to the server ? This function, I suppose, should be called from an ActionEvent handler.
The client class runs in a separate thread relative to the main application, so as not to hang the user interface. Is there a way to put the client in standby mode and turn it on only if you need to send a message to the server ?
onClickEvent. And it already hasString s = whereStringIs.getText(). And thens.sendSomeWhere();- michael_best pm