title: JavaFX padding of VBox with TitledPane
body: <p>Since I need to have multiple collapsible TitledPanes at once (which the default JavaFX Accordion does not support), I added some TitledPanes into a VBox. This works fine so far, but I realized that the width of the TitledPanes is 10px smaller than the width of the actual VBox.</p>
  
  <p>Following FXML code:</p>
  
  <pre><code>&lt;Pane prefHeight="700.0" prefWidth="1000.0" xmlns="http://javafx.com/javafx/8.0.71" xmlns:fx="http://javafx.com/fxml/1"&gt;
      &lt;children&gt;
          &lt;VBox prefHeight="700.0" prefWidth="1000.0"&gt;
              &lt;children&gt;
                  &lt;TitledPane animated="false" text="Pane 1"&gt;
                      &lt;content&gt;
                          &lt;AnchorPane prefHeight="300.0" /&gt;
                      &lt;/content&gt;
                  &lt;/TitledPane&gt;
                  &lt;TitledPane animated="false" text="Pane 2"&gt;
                      &lt;content&gt;
                          &lt;AnchorPane prefHeight="300.0" /&gt;
                      &lt;/content&gt;
                  &lt;/TitledPane&gt;
              &lt;/children&gt;
          &lt;/VBox&gt;
      &lt;/children&gt;
  &lt;/Pane&gt;
  </code></pre>
  
  <p>Which produces this (see the gap on the right):
  <a href="https://i.stack.imgur.com/hMHOh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hMHOh.png" alt="before"></a></p>
  
  <p>After adding and adapting a css file, the layout looks like this:
  <a href="https://i.stack.imgur.com/wlGww.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wlGww.png" alt="after"></a></p>
  
  <p>The css code:</p>
  
  <pre><code>VBox {
      -fx-padding: 0 -11 0 -1;
  }
  </code></pre>
  
  <p>For me, this solution works fine, however it seems like a poor workaround. I guess there needs to be a smarter solution?!</p>
  
  <p>Thanks a lot in advance :)</p>