javaFX crash when using an infinte loop : <p>I am trying to build a clock in javafx but the GUI crashes when I try using an infinite loop</p>

<pre><code>while (true) {
        Date time = new Date();

         // mins and hour are labels

        if (time.getMinutes() &lt; 10) {
            mins.setText("0" + Integer.toString(time.getMinutes()));    
        } else {
            mins.setText(Integer.toString(time.getMinutes()));
        }

        if (time.getHours() &lt; 10) {
            hour.setText(0 + Integer.toString(time.getHours()));    
        } else {
            hour.setText(Integer.toString(time.getHours()));
        }

    }
</code></pre>
