(fxml) Activate Button when user starts typing on TextField
<p>I have a TextField in my FXML and a Button to "save" whatever is in the TextField. I'd like to have the Button disabled up until the user starts typing in the TextField, in which the Button becomes clickable , and have it disabled again if the TextField becomes empty again, for me to ensure that you cannot "save" an empty string. I assume an EventHandler would work with this? or not, i don't know. Thank you!</p>

<p>FXML.fxml:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;

&lt;?import javafx.scene.control.Button?&gt;
&lt;?import javafx.scene.control.TextField?&gt;
&lt;?import javafx.scene.layout.AnchorPane?&gt;


&lt;AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="182.0" prefWidth="346.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1"&gt;
   &lt;children&gt;
      &lt;TextField layoutX="56.0" layoutY="83.0" /&gt;
      &lt;Button layoutX="241.0" layoutY="83.0" mnemonicParsing="false" text="Button" /&gt;
   &lt;/children&gt;
&lt;/AnchorPane&gt;
</code></pre>