title: JavaFX , fill accordion with fxml and Controller
body: <p>im new in java and javafx and i have a problem with an accordion.</p>
  
  <p>basically,i want load 3 times the same fxml into an accordion with the new instances of the controller</p>
  
  <pre><code>    @FXML public void AddAccordion()
  {   if(accordion.getPanes().size()&lt;=14){
      this.main.titlepanelist.add( new TitledPane("Number: "+ (accordion.getPanes().size()), TitledPane));
          try {
                  FXMLLoader loader= new FXMLLoader(Main.class.getResource("Pane.fxml"));
                  Parent root = (Parent) loader.load();
                  this.main.titlepaneliste.get(this.main.titlepaneliste.size()-1).setContent(root);
  
                  PaneGuiController paneGuiController = loader.getController();
                  paneGuiController.setMain(this.main,accordion.getPanes().size());
  
                  accordion.getPanes().add(this.main.titlepaneliste.get(this.main.titlepanelist.size()-1));
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }}
  </code></pre>
  
  <p>Here the Pane Controller:</p>
  
  <pre><code>public class CardioPaneController {
  public Main main;
  int nummer;
  @FXML private TextField textfield;
  @FXML private Button button;
  
  
  public void setMain(Main main,int nummer) 
  {
      this.main=main;
      his.nummer=nummer;
  }
  
  @FXML private void buttonclicked()
  {
  this.main.array[nummer].text=textfield.getText();
  }
  </code></pre>
  
  <p>if i load it and print the content of this.main.array:</p>
  
  <pre><code>Array [0]=3
  Array [1]=3
  Array [2]=3
  </code></pre>
  
  <p>but it should print:</p>
  
  <pre><code>Array [0]=1
  Array [1]=2
  Array [2]=3
  </code></pre>
  
  <p>if i save the first content at last then it shows:</p>
  
  <pre><code>Array [0]=1
  Array [1]=1
  Array [2]=1
  </code></pre>
  
  <p>is there any Error i didn´t see?</p>