title: JAVAFX Stage : Default button selection and alignment with text padding
body: <p>I am new to Javafx and trying to implement a Warning/Confirmation Dialog box for the User.</p>
  <p>I am able to get the dialog box, but unable to align it as per requirement.</p>
  <p>Below is how my dialog box looks currently:
  <a href="https://i.stack.imgur.com/Z05wT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z05wT.png" alt="enter image description here" /></a></p>
  <p>Now, I need to make two changes,</p>
  <ol>
  <li>I want to have buttons side by side, with yes first and no after that. But No should be selected by default. So that on closing No is sent as response.</li>
  <li>I want to have some space between the text and the buttons. Also is it possible to get text in two lines if the text size increases?</li>
  </ol>
  <p>Below is my current code:</p>
  <pre><code>public static boolean display(String title, String message){
          Stage window = new Stage();
          window.initModality(Modality.APPLICATION_MODAL);
          window.setTitle(&quot;Confirmation&quot;);
          window.setMinWidth(540);
          window.setMinHeight(250);
          Label label = new Label();
          label.setText(message);
  
          Button yesButton = new Button(&quot;Yes&quot;);
          Button noButton = new Button(&quot;no&quot;);
  
          yesButton.setOnAction(e-&gt;{
              answer = true;
              window.close();
          });
  
          noButton.setOnAction(e-&gt;{
              answer = false;
              window.close();
          });
          
          VBox layout = new VBox(10);
          layout.getChildren().addAll(label,noButton,yesButton);
          layout.setAlignment(Pos.CENTER);
          Scene scene = new Scene(layout);
          window.setScene(scene);
          window.showAndWait();
          return answer;
      }
  </code></pre>
  <p>Please help. Thanks in advance.</p>