2 Replies Latest reply: Oct 23, 2012 7:53 AM by biochemistry43 RSS

    Scene Builder ... Field fx: id is empty

    biochemistry43
      I am conducting with Scene GUI Builder, and I want to assign the fx: id my components but the field fx: id is empty.

      Actually I do not understand why,

      This is the code FXML:

      <?xml version="1.0" encoding="UTF-8"?>
      
      <?import java.lang.*?>
      <?import java.net.*?>
      <?import java.util.*?>
      <?import javafx.scene.*?>
      <?import javafx.scene.control.*?>
      <?import javafx.scene.layout.*?>
      
      <AnchorPane id="AnchorPane" fx:id="barraApoyoPlaneamiento" minHeight="40.0" minWidth="1116.0" prefHeight="40.0" prefWidth="1116.0" styleClass="mainFxmlClass, anchorpane" xmlns:fx="http://javafx.com/fxml" fx:controller="signa.BotonesApoyoPlaneamientoController">
        <children>
          <HBox id="HBox" alignment="CENTER" layoutX="405.0" layoutY="1.0" spacing="5.0" styleClass="Hbox">
            <children>
              <Button mnemonicParsing="false" text="Agregar Unidades">
                <minWidth>
                  <Long fx:value="94" />
                </minWidth>
                <prefWidth>
                  <Long fx:value="94" />
                </prefWidth>
              </Button>
              <Button mnemonicParsing="false" text="Editar Unidades">
                <minWidth>
                  <Long fx:value="94" />
                </minWidth>
                <prefWidth>
                  <Long fx:value="94" />
                </prefWidth>
              </Button>
            </children>
            <stylesheets>
              <URL value="@SIGNA.css" />
            </stylesheets>
          </HBox>
          <HBox id="HBox" alignment="CENTER" layoutX="612.0" layoutY="1.0" spacing="5.0" styleClass="Hbox">
            <children>
              <Button mnemonicParsing="false" text="Tareas">
                <minWidth>
                  <Long fx:value="94" />
                </minWidth>
                <prefWidth>
                  <Long fx:value="94" />
                </prefWidth>
              </Button>
              <Button mnemonicParsing="false" text="Marcadores">
                <minWidth>
                  <Long fx:value="94" />
                </minWidth>
                <prefWidth>
                  <Long fx:value="94" />
                </prefWidth>
              </Button>
              <Button mnemonicParsing="false" text="Derrotas">
                <minWidth>
                  <Long fx:value="94" />
                </minWidth>
                <prefWidth>
                  <Long fx:value="94" />
                </prefWidth>
              </Button>
              <Button mnemonicParsing="false" text="Patrones">
                <minWidth>
                  <Long fx:value="94" />
                </minWidth>
                <prefWidth>
                  <Long fx:value="94" />
                </prefWidth>
              </Button>
              <Button mnemonicParsing="false" text="metOc">
                <minWidth>
                  <Long fx:value="94" />
                </minWidth>
                <prefWidth>
                  <Long fx:value="94" />
                </prefWidth>
              </Button>
            </children>
            <stylesheets>
              <URL value="@SIGNA.css" />
            </stylesheets>
          </HBox>
          <HBox id="HBox" alignment="CENTER" layoutY="1.0" prefWidth="330.0" spacing="5.0" styleClass="Hbox">
            <children>
              <Button mnemonicParsing="false" text="Nuevo Plan">
                <minWidth>
                  <Long fx:value="94" />
                </minWidth>
                <prefWidth>
                  <Long fx:value="94" />
                </prefWidth>
              </Button>
              <Button mnemonicParsing="false" text="Nuevo Plan">
                <minWidth>
                  <Long fx:value="94" />
                </minWidth>
                <prefWidth>
                  <Long fx:value="94" />
                </prefWidth>
              </Button>
              <Button mnemonicParsing="false" text="Guardar Plan">
                <minWidth>
                  <Long fx:value="94" />
                </minWidth>
                <prefWidth>
                  <Long fx:value="94" />
                </prefWidth>
              </Button>
              <Button mnemonicParsing="false" text="Cerrar Plan">
                <minWidth>
                  <Long fx:value="94" />
                </minWidth>
                <prefWidth>
                  <Long fx:value="94" />
                </prefWidth>
              </Button>
            </children>
            <stylesheets>
              <URL value="@SIGNA.css" />
            </stylesheets>
          </HBox>
        </children>
        <stylesheets>
          <URL value="@SIGNA.css" />
        </stylesheets>
      </AnchorPane>
       
      This is the code of the controller class:
      package signa;
      
      import java.net.URL;
      import java.util.ResourceBundle;
      import javafx.fxml.FXML;
      import javafx.fxml.Initializable;
      import javafx.scene.control.Button;
      import javafx.scene.layout.AnchorPane;
      
      /**
       * FXML Controller class
       *
       * @author Administrador
       */
      public class BotonesApoyoPlaneamientoController implements Initializable {
      
          @FXML AnchorPane barraApoyoPlaneamiento;
          @FXML Button nvoPlanBtn;
          @FXML Button openPlanBtn;
          @FXML Button closePlanBtn;
          @FXML Button savePlanBtn;
          @FXML Button addUnitsBtn;
          @FXML Button editUnitsBtn;
          @FXML Button tareasBtn;
          @FXML Button marcadoresBtn;
          @FXML Button derrotasBtn;
          @FXML Button patronesBtn;
          @FXML Button metOCBtn;
         
          
          @Override
          public void initialize(URL url, ResourceBundle rb) {
              // TODO
          }    
      }
       
      I understand that it can not be wrong

      Edited by: biochemistry43 on 19-oct-2012 8:51