I speak Spanish not English, I am using the google translator.
I have a .FXML form with many TextField and a button to click and perform a mathematical operation with each of the values entered in TextField. I created a method that obtains the value of the text fields and performs the mathematical operation.
But if any of the text fields has changed the value, it must be recalculated by clicking on the button. I need that when pressing the enter key in any TextField, the method of mathematical operation is automatically executed, but I do not want to use the keyPressed method in each text field, it would be a long code, invoke the keyPressed method for each TextField.
I was thinking about creating a listener or a kind of Binding, that I join all the text fields or that I detected when there were changes in the text fields, or when the value entered is greater than zero.
textField.textProperty().addListener...
that method works, but I have many TextField, and I have to repeat that code many times. And I do not want to do that.
txt1..textProperty().addListener...
txt2..textProperty().addListener...
txt3..textProperty().addListener...
txt4..textProperty().addListener...
txt5..textProperty().addListener...
...
...
BooleanBinding bd = Binding.(txt1.textProp..., txt2textProp..., txt3.... ???
will it be possible?