title: JavaFX - How to prevent Toolbar from changing width on button state changes
body: <p>I have a problem with TooBar, when one of the included ToggleButtons gain/looses focus or gets checked/unchecked - their visual appearance become slightly bigger / or smaller by a few pixels but the Toolbar adjusts its width accordingly. </p>
  
  <p><a href="https://i.stack.imgur.com/rzCN0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rzCN0.png" alt="Focused Objects button"></a></p>
  
  <p>When I click on some other UI element - "Objects button" losses focus, becomes smaller and Toolbar width decreases. It's quite annoying that Toolbar size changes all the time. Also, the second button becomes not aligned with first one.</p>
  
  <p>What can be done here to keep all buttons aligned all the time regardless of their current state and have Toolbar width fixed ?</p>
  
  <p>The code for the vertical toolbar is:</p>
  
  <pre><code>&lt;HBox fx:id="leftPanelSwitchPanel"&gt;
          &lt;ToolBar orientation="VERTICAL" style="-fx-base: #d1ffd3;"&gt;
              &lt;Group&gt;
                  &lt;ToggleButton fx:id="objectListPanelSwitch" rotate="-90.0" text="Objects"&gt;
                      &lt;graphic&gt;
                          &lt;MaterialIconView glyphName="FORMAT_LIST_BULLETED" /&gt;
                      &lt;/graphic&gt;
                  &lt;/ToggleButton&gt;
              &lt;/Group&gt;
              &lt;Group&gt;
                  &lt;ToggleButton fx:id="objectPropertiesPanelSwitch" rotate="-90.0" text="Properties"&gt;
                      &lt;graphic&gt;
                          &lt;MaterialIconView glyphName="SETTINGS_APPLICATIONS" /&gt;
                      &lt;/graphic&gt;
                  &lt;/ToggleButton&gt;
              &lt;/Group&gt;
          &lt;/ToolBar&gt;
      &lt;/HBox&gt;
  </code></pre>