Right align menu in menubar in JavaFX
<p>In <code>Java Swing</code> it is possible to put a menu on the right side of the menu bar using:</p>

<pre><code>menubar.add(menu1);
menubar.add(Box.createHorizontalGlue());
menubar.add(menu2);
</code></pre>

<p>This will put <code>menu1</code> on the left and <code>menu2</code> on the right. This function is (obviously) not available in <code>JavaFX</code>.</p>

<p>In <code>JavaFX</code>, I have seen that the same can be achieved for a toolbar using: </p>

<pre><code>final Pane rightSpacer = new Pane();
HBox.setHgrow(
    rightSpacer,
    Priority.SOMETIMES
);
</code></pre>

<p>Although, this workaround is not usuable for menus. </p>

<p><strong>Question</strong>: is there a way to create a right spacer for menus in <code>JavaFX</code>?</p>