title: How to implement a sliding pane using JavaFx 8?
body: <p>I'm currently experimenting with <strong>JavaFx 8</strong> and its different <strong>Panes</strong>.</p>
  
  <p>So I want to implement a <em>hidden Pane with a visible Button</em> which follows a set of rules, for example:</p>
  
  <ul>
  <li>The Pane can be placed in 4 positions within its parent: <em>TOP_CENTER, BOTTOM_CENTER, RIGHT_CENTER, LEFT_CENTER</em>; in which the button is placed on top-most or left-most border of the Pane.</li>
  <li>The Pane is mostly hidden and only the button is visible. If the user clicks on the button, the Pane slides-in. On clicking again, the Pane slides-out again.</li>
  <li>The background of Pane and Button should be non-transparent, so that its content differs from the main content from parent.</li>
  </ul>
  
  <p>Now follows ASCII-art... ;)</p>
  
  <pre><code>+------------+                            +------------+
  |            |                            |            |
  |          +-|                            |  +-+-------+
  |          |X| (The **X** is the button,  |  |X|#######|
  |          +-|  which now was clicked =&gt;) |  +-+#######|
  |            |                            |    |#######|
  |            |                            |    |#######|
  |            |                            |    +-------+
  +------------+                            +------------+
  </code></pre>
  
  <p>My current state is having a <code>StackPane</code> as parent/container and placing a <code>BorderPane</code> with <code>Button</code> on the left and another control centered, which acts as hidden content.
  The <code>BorderPane</code> is aligned with <code>StackPane.setAlignment(borderPane, Pos.CENTER_RIGHT)</code>. The preferred height and width properties are bound to a factor of its parent's (but shown always at the same) size... Also backgrounds are transparent...</p>
  
  <p><strong>Any ideas?</strong></p>