2015-03-30 71 views
0

我曾經有一個RootLayout邊框窗格,其上有一個fx:includes Anchor窗格,上面有我的控制器。我試圖將這兩個文件合併成一個.fxml文件,但我遇到了一個問題,試圖與我的應用程序的上半部分(按鈕,組合框等不可點擊)進行交互。我假設我的組織存在問題,或者甚至可能超過高度,但我沒有看到它,這是我的第一個javaFX應用程序。如果我在JavaFX Scene Builder中打開.fxml,我只能看到層次結構中的邊框窗格。無法與JavaFX控件交互 - 可能的.fxml佈局問題

這裏是舊體制有兩個.fxml文件

老RootLayout.fxml

<?xml version="1.0" encoding="UTF-8"?> 

<?import javafx.geometry.*?> 
<?import javafx.scene.control.*?> 
<?import java.lang.*?> 
<?import javafx.scene.layout.*?> 
<?import javafx.scene.layout.BorderPane?> 

<BorderPane prefHeight="500.0" prefWidth="500.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"> 
    <children> 
    <fx:include fx:id="Tabs" source="Tabs.fxml" /> 
    </children> 
</BorderPane> 

老Tabs.fxml

<?xml version="1.0" encoding="UTF-8"?> 

<?import javafx.geometry.*?> 
<?import java.lang.*?> 
<?import javafx.scene.control.*?> 
<?import javafx.scene.layout.*?> 

<AnchorPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="asset.view.TabsController"> 
    <children> 
     <AnchorPane prefHeight="125.0" prefWidth="500.0" AnchorPane.bottomAnchor="375.0"> 
      <children> 
       <GridPane AnchorPane.leftAnchor="10.0" AnchorPane.topAnchor="35.0"> 
        <columnConstraints> 
         <ColumnConstraints hgrow="SOMETIMES" maxWidth="95.0" minWidth="10.0" prefWidth="74.0" /> 
         <ColumnConstraints hgrow="SOMETIMES" maxWidth="125.0" minWidth="125.0" prefWidth="125.0" /> 
         <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> 
        </columnConstraints> 
        <rowConstraints> 
         <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
         <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
        </rowConstraints> 
        <children> 
         <Button mnemonicParsing="false" onAction="#handleInputRecord" text="Submit" GridPane.columnIndex="2"> 
          <GridPane.margin> 
           <Insets left="5.0" /> 
          </GridPane.margin> 
         </Button> 
         <Label text="Employee ID" /> 
         <Label text="Asset ID" GridPane.rowIndex="1" /> 
         <ComboBox fx:id="inputEmployeeIdField" minWidth="125.0" GridPane.columnIndex="1" /> 
         <ComboBox fx:id="inputAssetIdField" minWidth="125.0" GridPane.columnIndex="1" GridPane.rowIndex="1" /> 
        </children> 
       </GridPane> 
      </children> 
     </AnchorPane> 
     <MenuBar prefWidth="500.0" BorderPane.alignment="CENTER"> 
      <menus> 
       <Menu mnemonicParsing="false" text="File"> 
        <items> 
         <MenuItem mnemonicParsing="false" text="Close" /> 
        </items> 
       </Menu> 
       <Menu mnemonicParsing="false" text="Help"> 
        <items> 
         <MenuItem mnemonicParsing="false" text="About" /> 
        </items> 
       </Menu> 
      </menus> 
     </MenuBar>  
     <AnchorPane prefHeight="375.0" prefWidth="500.0" AnchorPane.topAnchor="125.0"> 
      <children> 
       <TabPane nodeOrientation="LEFT_TO_RIGHT" prefHeight="375.0" prefWidth="500.0" tabClosingPolicy="UNAVAILABLE"> 
        <tabs>  
         <Tab text="Overview"> 
          <content> 
           <SplitPane dividerPositions="0.5761872909698996" focusTraversable="true"> 
            <items> 
             <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"> 
              <children> 
               <TableView fx:id="overviewTable" layoutX="-12.5" layoutY="58.0" prefHeight="320.0" prefWidth="175.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> 
                <columns> 

                 <TableColumn fx:id="overviewAssetIdColumn" minWidth="60.0" text="Asset ID" /> 
                 <TableColumn fx:id="overviewEmployeeIdColumn" minWidth="70.0" text="Employee ID" /> 
                 <TableColumn fx:id="overviewAssetNameColumn" minWidth="80.0" text="Asset Name" /> 
                 <TableColumn fx:id="overviewInventoryStatusColumn" minWidth="50.0" text="Status" /> 
                </columns> 
                <columnResizePolicy> 
                 <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /> 
                </columnResizePolicy> 
               </TableView> 
              </children> 
             </AnchorPane> 
             <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="298.0" prefWidth="400.0"> 
              <children> 
               <Label layoutX="7.0" layoutY="6.0" text="Overview Details:" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="5.0" /> 
               <GridPane layoutX="14.0" layoutY="33.0" AnchorPane.leftAnchor="5.0" AnchorPane.rightAnchor="5.0" AnchorPane.topAnchor="30.0"> 
                <columnConstraints> 
                 <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> 
                 <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> 
                 <ColumnConstraints /> 
                 <ColumnConstraints /> 
                 <ColumnConstraints /> 
                 <ColumnConstraints /> 
                 <ColumnConstraints /> 
                 <ColumnConstraints /> 
                </columnConstraints> 
                <rowConstraints> 
                 <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                 <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                 <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                 <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                 <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                 <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                 <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                 <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                </rowConstraints> 
                <children> 
                 <Label text="Asset ID" /> 
                 <Label text="Asset Name" GridPane.rowIndex="1" /> 
                 <Label text="Manufacturer" GridPane.rowIndex="2" /> 
                 <Label text="Equipment Type" GridPane.rowIndex="3" /> 
                 <Label text="Employee ID" GridPane.rowIndex="4" /> 
                 <Label text="Employee Name" GridPane.rowIndex="5" /> 
                 <Label text="Check Out Date" GridPane.rowIndex="6" /> 
                 <Label fx:id="overviewAssetIdLabel" text="Label" GridPane.columnIndex="1" /> 
                 <Label fx:id="overviewAssetNameLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="1" /> 
                 <Label fx:id="overviewManufacturerLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="2" /> 
                 <Label fx:id="overviewTypeLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="3" /> 
                 <Label fx:id="overviewEmployeeIdLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="4" /> 
                 <Label fx:id="overviewEmployeeNameLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="5" /> 
                 <Label fx:id="overviewCheckOutDateLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="6" /> 
                 <Label fx:id="overviewIdLabel" text="" GridPane.columnIndex="7" /> 
                </children> 
               </GridPane> 
               <HBox layoutX="215.0" layoutY="259.0" spacing="5.0" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="10.0"> 
                <children> 
                 <Button mnemonicParsing="false" onAction="#handleOverviewRefresh" text="Refresh" /> 
                </children> 
               </HBox> 

              </children> 
             </AnchorPane> 
            </items> 
           </SplitPane> 
          </content> 
         </Tab> 

         <Tab text="Employees"> 
          <content> 
           <SplitPane dividerPositions="0.42618729096989966" focusTraversable="true"> 
            <items> 
             <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"> 
              <children> 
               <TableView fx:id="employeeTable" layoutX="-12.5" layoutY="58.0" prefHeight="298.0" prefWidth="175.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> 
                <columns> 
                 <TableColumn fx:id="employeeFirstNameColumn" minWidth="102.0" text="First Name" /> 
                 <TableColumn fx:id="employeeLastNameColumn" minWidth="114.0" text="Last Name" /> 
                </columns> 
                <columnResizePolicy> 
                 <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /> 
                </columnResizePolicy> 
               </TableView> 
              </children> 
             </AnchorPane> 
             <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="298.0" prefWidth="393.0"> 
              <children> 
               <Label layoutX="7.0" layoutY="6.0" text="Employee Details:" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="5.0" /> 
               <GridPane layoutX="14.0" layoutY="33.0" AnchorPane.leftAnchor="5.0" AnchorPane.rightAnchor="5.0" AnchorPane.topAnchor="30.0"> 
                <columnConstraints> 
                 <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> 
                 <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> 
                 <ColumnConstraints /> 
                 <ColumnConstraints /> 
                 <ColumnConstraints /> 
                </columnConstraints> 
                <rowConstraints> 
                 <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                 <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                 <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                 <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                </rowConstraints> 
                <children> 
                 <Label text="Employee ID" /> 
                 <Label text="First Name" GridPane.rowIndex="1" /> 
                 <Label text="Last Name" GridPane.rowIndex="2" /> 
                 <Label text="Status" GridPane.rowIndex="3" /> 
                 <Label fx:id="employeeEmployeeIdLabel" text="Label" GridPane.columnIndex="1" /> 
                 <Label fx:id="employeeFirstNameLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="1" /> 
                 <Label fx:id="employeeLastNameLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="2" /> 
                 <Label fx:id="employeeStatusLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="3" /> 
                 <Label fx:id="employeeIdLabel" text="" GridPane.columnIndex="4" /> 
                </children> 
               </GridPane> 
               <HBox layoutX="215.0" layoutY="259.0" spacing="5.0" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="10.0"> 
                <children> 
                 <Button mnemonicParsing="false" onAction="#handleNewEmployee" text="New..." /> 
                 <Button mnemonicParsing="false" onAction="#handleEditEmployee" text="Edit..." /> 
                 <Button mnemonicParsing="false" onAction="#handleDeleteEmployee" text="Delete" /> 
                </children> 
               </HBox> 
              </children> 
             </AnchorPane> 
            </items> 
           </SplitPane> 
          </content> 
         </Tab>  
        </tabs> 
       </TabPane> 
      </children> 
     </AnchorPane> 
    </children> 
</AnchorPane> 

新組合Rootlayout.fxml和Tabs.fxml現在命名爲RootLayoutTabs.fxml

<?xml version="1.0" encoding="UTF-8"?> 

<?import javafx.geometry.*?> 
<?import java.lang.*?> 
<?import javafx.scene.control.*?> 
<?import javafx.scene.layout.*?> 

<BorderPane prefHeight="500.0" prefWidth="500.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="asset.view.TabsController"> 
    <children> 
     <AnchorPane prefHeight="125.0" prefWidth="500.0" AnchorPane.bottomAnchor="375.0">   
      <children> 

     <MenuBar prefWidth="500.0" BorderPane.alignment="CENTER"> 
      <menus> 
       <Menu mnemonicParsing="false" text="File"> 
        <items> 
         <MenuItem mnemonicParsing="false" text="Close" /> 
        </items> 
       </Menu> 
       <Menu mnemonicParsing="false" text="Help"> 
        <items> 
         <MenuItem mnemonicParsing="false" text="About" /> 
        </items> 
       </Menu> 
      </menus> 
     </MenuBar>   

       <GridPane AnchorPane.leftAnchor="10.0" AnchorPane.topAnchor="35.0"> 
        <columnConstraints> 
         <ColumnConstraints hgrow="SOMETIMES" maxWidth="95.0" minWidth="10.0" prefWidth="74.0" /> 
         <ColumnConstraints hgrow="SOMETIMES" maxWidth="125.0" minWidth="125.0" prefWidth="125.0" /> 
         <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> 
        </columnConstraints> 
        <rowConstraints> 
         <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
         <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
        </rowConstraints> 
        <children> 
         <Button mnemonicParsing="false" onAction="#handleInputRecord" text="Submit" GridPane.columnIndex="2"> 
          <GridPane.margin> 
           <Insets left="5.0" /> 
          </GridPane.margin> 
         </Button> 
         <Label text="Employee ID" /> 
         <Label text="Asset ID" GridPane.rowIndex="1" /> 
         <ComboBox fx:id="inputEmployeeIdField" minWidth="125.0" GridPane.columnIndex="1" /> 
         <ComboBox fx:id="inputAssetIdField" minWidth="125.0" GridPane.columnIndex="1" GridPane.rowIndex="1" /> 
        </children> 
       </GridPane> 

        </children> 
     </AnchorPane> 
     <AnchorPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"> 
      <children> 
       <AnchorPane prefHeight="375.0" prefWidth="500.0" AnchorPane.topAnchor="125.0"> 
        <children> 
         <TabPane nodeOrientation="LEFT_TO_RIGHT" prefHeight="375.0" prefWidth="500.0" tabClosingPolicy="UNAVAILABLE"> 
          <tabs> 
           <Tab text="Overview"> 
            <content> 
             <SplitPane dividerPositions="0.5761872909698996" focusTraversable="true"> 
              <items> 
               <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"> 
                <children> 
                 <TableView fx:id="overviewTable" layoutX="-12.5" layoutY="58.0" prefHeight="320.0" prefWidth="175.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> 
                  <columns> 

                   <TableColumn fx:id="overviewAssetIdColumn" minWidth="60.0" text="Asset ID" /> 
                   <TableColumn fx:id="overviewEmployeeIdColumn" minWidth="70.0" text="Employee ID" /> 
                   <TableColumn fx:id="overviewAssetNameColumn" minWidth="80.0" text="Asset Name" /> 
                   <TableColumn fx:id="overviewInventoryStatusColumn" minWidth="50.0" text="Status" /> 
                  </columns> 
                  <columnResizePolicy> 
                   <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /> 
                  </columnResizePolicy> 
                 </TableView> 
                </children> 
               </AnchorPane> 
               <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="298.0" prefWidth="400.0"> 
                <children> 
                 <Label layoutX="7.0" layoutY="6.0" text="Overview Details:" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="5.0" /> 
                 <GridPane layoutX="14.0" layoutY="33.0" AnchorPane.leftAnchor="5.0" AnchorPane.rightAnchor="5.0" AnchorPane.topAnchor="30.0"> 
                  <columnConstraints> 
                   <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> 
                   <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> 
                   <ColumnConstraints /> 
                   <ColumnConstraints /> 
                   <ColumnConstraints /> 
                   <ColumnConstraints /> 
                   <ColumnConstraints /> 
                   <ColumnConstraints /> 
                  </columnConstraints> 
                  <rowConstraints> 
                   <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                   <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                   <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                   <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                   <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                   <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                   <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                   <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                  </rowConstraints> 
                  <children> 
                   <Label text="Asset ID" /> 
                   <Label text="Asset Name" GridPane.rowIndex="1" /> 
                   <Label text="Manufacturer" GridPane.rowIndex="2" /> 
                   <Label text="Equipment Type" GridPane.rowIndex="3" /> 
                   <Label text="Employee ID" GridPane.rowIndex="4" /> 
                   <Label text="Employee Name" GridPane.rowIndex="5" /> 
                   <Label text="Check Out Date" GridPane.rowIndex="6" /> 
                   <Label fx:id="overviewAssetIdLabel" text="Label" GridPane.columnIndex="1" /> 
                   <Label fx:id="overviewAssetNameLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="1" /> 
                   <Label fx:id="overviewManufacturerLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="2" /> 
                   <Label fx:id="overviewTypeLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="3" /> 
                   <Label fx:id="overviewEmployeeIdLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="4" /> 
                   <Label fx:id="overviewEmployeeNameLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="5" /> 
                   <Label fx:id="overviewCheckOutDateLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="6" /> 
                   <Label fx:id="overviewIdLabel" text="" GridPane.columnIndex="7" /> 
                  </children> 
                 </GridPane> 
                 <HBox layoutX="215.0" layoutY="259.0" spacing="5.0" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="10.0"> 
                  <children> 
                   <Button mnemonicParsing="false" onAction="#handleOverviewRefresh" text="Refresh" /> 
                  </children> 
                 </HBox> 

                </children> 
               </AnchorPane> 
              </items> 
             </SplitPane> 
            </content> 
           </Tab> 
           <Tab text="Employees"> 
            <content> 
             <SplitPane dividerPositions="0.42618729096989966" focusTraversable="true"> 
              <items> 
               <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"> 
                <children> 
                 <TableView fx:id="employeeTable" layoutX="-12.5" layoutY="58.0" prefHeight="298.0" prefWidth="175.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> 
                  <columns> 
                   <TableColumn fx:id="employeeFirstNameColumn" minWidth="102.0" text="First Name" /> 
                   <TableColumn fx:id="employeeLastNameColumn" minWidth="114.0" text="Last Name" /> 
                  </columns> 
                  <columnResizePolicy> 
                   <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /> 
                  </columnResizePolicy> 
                 </TableView> 
                </children> 
               </AnchorPane> 
               <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="298.0" prefWidth="393.0"> 
                <children> 
                 <Label layoutX="7.0" layoutY="6.0" text="Employee Details:" AnchorPane.leftAnchor="5.0" AnchorPane.topAnchor="5.0" /> 
                 <GridPane layoutX="14.0" layoutY="33.0" AnchorPane.leftAnchor="5.0" AnchorPane.rightAnchor="5.0" AnchorPane.topAnchor="30.0"> 
                  <columnConstraints> 
                   <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> 
                   <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> 
                   <ColumnConstraints /> 
                   <ColumnConstraints /> 
                   <ColumnConstraints /> 
                  </columnConstraints> 
                  <rowConstraints> 
                   <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                   <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                   <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                   <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> 
                  </rowConstraints> 
                  <children> 
                   <Label text="Employee ID" /> 
                   <Label text="First Name" GridPane.rowIndex="1" /> 
                   <Label text="Last Name" GridPane.rowIndex="2" /> 
                   <Label text="Status" GridPane.rowIndex="3" /> 
                   <Label fx:id="employeeEmployeeIdLabel" text="Label" GridPane.columnIndex="1" /> 
                   <Label fx:id="employeeFirstNameLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="1" /> 
                   <Label fx:id="employeeLastNameLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="2" /> 
                   <Label fx:id="employeeStatusLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="3" /> 
                   <Label fx:id="employeeIdLabel" text="" GridPane.columnIndex="4" /> 
                  </children> 
                 </GridPane> 
                 <HBox layoutX="215.0" layoutY="259.0" spacing="5.0" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="10.0"> 
                  <children> 
                   <Button mnemonicParsing="false" onAction="#handleNewEmployee" text="New..." /> 
                   <Button mnemonicParsing="false" onAction="#handleEditEmployee" text="Edit..." /> 
                   <Button mnemonicParsing="false" onAction="#handleDeleteEmployee" text="Delete" /> 
                  </children> 
                 </HBox> 
                </children> 
               </AnchorPane> 
              </items> 
             </SplitPane> 
            </content> 
           </Tab>         
          </tabs> 
         </TabPane> 
        </children> 
       </AnchorPane> 
      </children> 
     </AnchorPane> 
    </children> 
</BorderPane> 

回答

0

我想通了。我有一個額外的錨窗格,它不喜歡。我刪除了下面的代碼;

<AnchorPane prefHeight="125.0" prefWidth="500.0" AnchorPane.bottomAnchor="375.0"> 
<children> 
</children> 
</AnchorPane> 
+0

你在FXML中有一些其他奇怪的東西。你設置的BorderPane的孩子有點不明確(我認爲),而應該設置頂部/底部/左/右節點。當您直接設置邊框窗格的子項時,SceneBuilder甚至不會在層次結構面板中正確顯示佈局的層次結構。你真的只是從頭到尾佈局我認爲,所以使用VBox而不是BorderPane作爲你的根可能更合適。 – jewelsea 2015-03-30 19:09:13