title: JavaFX controller to controller - access to UI Controls
body: <p>After research on my MVC javaFX - Problem without any solution for more than 2 days, I decided now to post it:</p>
  
  <p>I've one application Window divided by different SplitPanes and each of this Panes has its own .fxml-form controlled by its own controller.</p>
  
  <p>My Question is: How is it possible to get access to external UI-Controlls?
  For Example: Clicking on a TableView-row should effect to fill Textfields in an other Form.</p>
  
  <p>My current (not working) Solution is as follows:</p>
  
  <p><strong>1st Controller:</strong> Providing an instance</p>
  
  <pre><code>public static SpielerController instance;
      public SpielerController() {};
      public static SpielerController getInstance()
      {   
          if(SpielerController.instance==null)
          {
              synchronized (SpielerController.class)
              {
                  if(SpielerController.instance == null)
                  {
                      SpielerController.instance = new SpielerController();
                  }
              }
          }
  
          return SpielerController.instance;
  
      }
  </code></pre>
  
  <p><strong>2nd Controller:</strong> Getting an instance and invoking a Method</p>
  
  <pre><code>SpielerController.getInstance().setPID(Integer.toString(pid));
  </code></pre>
  
  <p>The result is:</p>
  
  <ul>
  <li><p>it is possible to pass the value pid to the invoked method and print it out (<code>System.out.println(pid);</code>)</p></li>
  <li><p>it is not possible to set a value e.g. <code>TextField1.setText(pid);</code></p></li>
  </ul>
  
  <p>Is it possible to set values in this way and when yes - how?</p>
  
  <p>Is there maybe an other (better) way to meet this demand?</p>