title: Set Space between elements in JavaFX (Responsive window)
body: <p>My target is to build a Window in Javafx where there are three buttons and a label.</p>
  <ol>
  <li>Two buttons(1,2) on the left side will have 12px between them</li>
  <li>Third button(3) will be on the right side of the window</li>
  <li>And Lable will be the center of Button No. 2 and 3 (The text should be centered regardless of the window size)</li>
  </ol>
  <p>This will be the expected output - <a href="https://i.stack.imgur.com/yXQek.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yXQek.png" alt="Expected Output" /></a></p>
  <p>My Code--</p>
  <pre><code> public void start(Stage stage) throws Exception {
  
      stage.setTitle(&quot;Advent Calender&quot;);
  
      Button button1 = new Button(&quot;Cheat&quot;);
      Button button2 = new Button(&quot;Regret&quot;);
      Button button3 = new Button(&quot;About&quot;);
  
  
      Label label = new Label(&quot;Placeholder for calendar&quot;);
      Label label1 = new Label(&quot;Advent Calendar 0.1 Alpha&quot;);
  
      HBox hbox1 = new HBox(button1,button2);
  
      HBox hbox2 = new HBox(label1);
      HBox hbox3 = new HBox(button3);
  
      hbox1.setSpacing(12);
      hbox1.setAlignment(Pos.BASELINE_LEFT);
  
      hbox2.setAlignment(Pos.BASELINE_LEFT);
  
      hbox3.setAlignment(Pos.BASELINE_RIGHT);
  
  
      StackPane layout = new StackPane();
      layout.getChildren().addAll(label,hbox1,hbox2,hbox3);
      
  
  
      Scene scene = new Scene(layout, 600, 800);
      stage.setScene(scene);
      stage.show();
  
  }
  </code></pre>
  <blockquote>
  <p>I was able to fulfill the first and 2nd condition however third one is the problem, when resizing the window label overlapping button (1,2)</p>
  </blockquote>