title: how to lock the size of a Stage in java
body: <p>I made a very simple java application with 3 scenes and 3 buttons.
  button3 (b3) opens a popup but I set the image to lock size but the window can still be changed by using the mouse on one of the corners.
  is there a way to lock the size so the curson can't edit this?</p>
  
  <p>Here's the simplified code (just to get and idea)</p>
  
  <pre><code>public class Handler extends Application
  {
  
      @Override
      public void start(Stage primaryStage) throws Exception { 
  
          Button button1 =  new Button("AD");
  
          VBox layout1 = new VBox(button1);
          layout2.setAlignment(Pos.CENTER);
  
  
          Pane layout2 = new Pane();
          layout3.setStyle("-fx-background-image: url(ad.jpg);" +
                          "-fx-background-repeat: no-repeat;" +
                          "-fx-background-size: initial;");
  
  
  
          Scene scene1 = new Scene(layout1);
          Scene scene2 = new Scene(layout2);
  
          //Stage (window)
          primaryStage.setTitle("Basic Handler");
          primaryStage.setScene(scene1);
          primaryStage.setHeight(400);
          primaryStage.setWidth(400);
          primaryStage.show();
  
          button1.setOnAction(event -&gt; {
              Stage PopUp = new Stage();
              PopUp.setHeight(266);
              PopUp.setWidth(474);
              PopUp.setTitle("Sponsored AD");
              PopUp.setScene(scene2);
              PopUp.showAndWait();
          });
      }
  }
  </code></pre>