title: JAVAFX - Windows rights calling
body: <p>I have two good working windows (main window, first window) in seperate .java files, at the same package.</p>
  
  <p>The program handles, if I call the the First window (from the main), the Main stays in the background. The only problem is that I still can use the main window if I click there, and create infinity first windows.</p>
  
  <p>One solution is to shut down the Main window, to avoid clicking there again, but I would like to keep there. In order to make the solution I need a code which makes the background window somehow disabled until I click something in the First Window.
   But to do that I need to give the rights to the "handler.java" to operate with the main. </p>
  
  <p>Anybody has any idea how to do that?</p>
  
  <p>Let me show you the 2 java file's methods:</p>
  
  <p>Main.java:</p>
  
  <pre><code>  public class program extends Application {
  
  @Override
  public void start(Stage main) throws Exception {
      Parent root = FXMLLoader.load(getClass().getResource("mainwindow.fxml"));
      Scene scene = new Scene(root);
  
      main.setScene(scene);
      main.setTitle("Main);
      main.setWidth(800);
      main.setHeight(600);
      main.setResizable(false);
  
            main.show();
  </code></pre>
  
  <p>First.java</p>
  
  <pre><code>    public void first() throws Exception {
      Parent root = FXMLLoader.load(getClass().getResource("first.fxml"));
      Scene scene = new Scene(root);
      Stage first = new Stage();     
      first.setScene (scene);
      first.setTitle("Köszöntjük az Útiokosban!");
      first.setWidth(400);
      first.setHeight(200);
      first.setResizable(false);
  
            first.show();
  
  }
  </code></pre>