title: Prevent a toggle group from not having a toggle selected - Java FX
body: <p>I have a toggle group with two toggle buttons that should look like this (Yellow toggle is the selected toggle). </p>
  
  <p><a href="https://i.stack.imgur.com/2A7pO.png" rel="noreferrer"><img src="https://i.stack.imgur.com/2A7pO.png" alt="enter image description here"></a></p>
  
  <p>However when I click on the selected toggle both toggles become unselected and look like this.</p>
  
  <p><a href="https://i.stack.imgur.com/p6sd4.png" rel="noreferrer"><img src="https://i.stack.imgur.com/p6sd4.png" alt="enter image description here"></a></p>
  
  <p>Then if I try to get whether the toggle is selected, I get a <code>nullPointerException</code>.</p>
  
  <pre><code>(Boolean) toggleGroup.getSelectedToggle().getUserData();
  </code></pre>
  
  <p>Is it possible to prevent the selected toggle from being unselected when it is clicked?</p>