title: Editing values/properties of an object of the controller class from another class
body: <p>I have tried following the solution from here but without success: <a href="https://stackoverflow.com/questions/28529482/javafx-change-label-text-from-another-class-with-controller">JavaFX Change label text from another class with controller</a></p>
  
  <p>I am not sure if they want the same as I do.</p>
  
  <p>So basically what I have is: <code>FXMLDocumentController.java</code>, <code>FXMLDocument.xml, Operations.java</code>, and <code>Main.java</code>. (I have some other classes that make the Arduino connection)</p>
  
  <p>This is the start method that I have in my <code>Main.java</code>: </p>
  
  <pre><code>@Override
  public void start(Stage primaryStage) throws IOException {
  
      Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));
  
      Scene scene = new Scene(root);
  
      primaryStage.setTitle("This is the title");
      primaryStage.setScene(scene);
      primaryStage.show();
  
  }
  </code></pre>
  
  <p>EDIT:
  Here's my Operations.java:</p>
  
  <pre><code>public class Operations {
  
  private String mensagem, hora, dados;
  private String [] msgSeparada, dadosSeparados;
  private int origem, destino, tipoMensagem, comprimento;
  private int [] estadoDosSensores;
  
  public FiltrarMensagem(String mensagem) {
      //remove o primeiro e ultimo carater
      mensagem = mensagem.substring(1, mensagem.length()-2);
      this.mensagem = mensagem;
      System.out.printf("Mensagem Recebida: %s\n", mensagem);
      msgSeparada = this.mensagem.split(";");
      destino = Integer.valueOf(msgSeparada[0]);
      origem = Integer.valueOf(msgSeparada[1]);
      hora = msgSeparada[2];
      tipoMensagem = Integer.valueOf(msgSeparada[3]);
      comprimento = Integer.valueOf(msgSeparada[4]);
      dados = msgSeparada[5];
      dadosSeparados = dados.split(",");
  }
  
  public void imprimir() {
      System.out.printf("Origem: %d\n", origem);
      System.out.printf("Destino: %d\n", destino);
      System.out.printf("Hora: %s\n", hora);
      System.out.printf("Tipo de Mensagem: %d\n", tipoMensagem);
      System.out.printf("Comprimento: %d\n", comprimento);
      System.out.printf("Dados: %s\n\n", dados);
      if(Integer.valueOf(dadosSeparados[0]) == 1) {
                  //change label value here
      }
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>To simplify, here's what my program does:</p>
  
  <p>I have my controller class with 2 simple buttons that receive data from the serial port coming from an Arduino, and with the data received from the Arduino, I create an object of the class Operations so I can make the necessary changes depending on the data received from the Arduino, and what I would like to do is to change labels and all the objects available at the FXML file, but I am not able to do that. What is the simplest way to do it? </p>
  
  <p>I've tried everything and with no success... So would really appreciate if someone could help me on this.</p>