2016-09-16 183 views
0

如何將AnchorPane綁定到屏幕大小?使anchorpane可調整大小與屏幕大小

當我運行我的代碼它讓我發現:

enter image description here

但是當主舞臺適應屏幕的AnchorPane仍然具有相同的尺寸。

enter image description here

這裏是我的FXML文件

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

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

<AnchorPane id="AnchorPane" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="768.0" prefWidth="1024.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sanad.Entry_Page"> 
    <children> 
     <Pane blendMode="RED" layoutX="563.0" layoutY="9.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minWidth="-Infinity" prefHeight="746.0" prefWidth="447.0"> 
     <padding> 
      <Insets top="10.0" /> 
     </padding> 
     <children> 
      <SplitPane dividerPositions="0.5720620842572062" layoutX="-56.0" layoutY="-1.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="741.0" prefWidth="508.0"> 
       <items> 
       <AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" prefHeight="751.0" prefWidth="286.0"> 
        <children> 
         <TextField fx:id="formnumer_field" layoutX="8.0" layoutY="14.0" prefHeight="30.0" prefWidth="235.0" /> 
         <TextField fx:id="sectornumber_field" layoutX="8.0" layoutY="48.0" prefHeight="30.0" prefWidth="235.0" /> 
         <TextField fx:id="fathername_field" layoutX="8.0" layoutY="82.0" prefHeight="30.0" prefWidth="235.0" /> 
         <ComboBox fx:id="fatherborn_year" layoutX="8.0" layoutY="116.0" prefHeight="25.0" prefWidth="70.0" /> 
         <ComboBox fx:id="fatherborn_month" layoutX="85.0" layoutY="116.0" prefHeight="25.0" prefWidth="70.0" /> 
         <ComboBox fx:id="fatherborn_day" layoutX="162.0" layoutY="116.0" prefHeight="25.0" prefWidth="80.0" /> 
         <TextField fx:id="fathercurrentjob" layoutX="8.0" layoutY="145.0" prefHeight="30.0" prefWidth="235.0" /> 
         <TextField fx:id="fatherprevjob" layoutX="8.0" layoutY="179.0" prefHeight="30.0" prefWidth="235.0" /> 
         <TextField fx:id="mothername_field" layoutX="8.0" layoutY="215.0" prefHeight="30.0" prefWidth="235.0" /> 
         <TextField fx:id="mother_curr_job" layoutX="8.0" layoutY="278.0" prefHeight="30.0" prefWidth="235.0" /> 
         <ComboBox fx:id="motherborn_day" layoutX="162.0" layoutY="249.0" prefHeight="25.0" prefWidth="80.0" /> 
         <ComboBox fx:id="motherborn_year" layoutX="8.0" layoutY="249.0" prefHeight="25.0" prefWidth="70.0" /> 
         <TextField fx:id="mother_prev_job" layoutX="8.0" layoutY="312.0" prefHeight="30.0" prefWidth="235.0" /> 
         <ComboBox fx:id="motherborn_month" layoutX="85.0" layoutY="249.0" prefHeight="25.0" prefWidth="70.0" /> 
         <TextField fx:id="homepartner_num" layoutX="8.0" layoutY="346.0" prefHeight="30.0" prefWidth="235.0" /> 
         <ComboBox fx:id="homepartner_year" layoutX="11.0" layoutY="382.0" prefHeight="25.0" prefWidth="70.0" /> 
         <ComboBox fx:id="homepartner_month" layoutX="88.0" layoutY="382.0" prefHeight="25.0" prefWidth="70.0" /> 
         <ComboBox fx:id="homepartner_day" layoutX="163.0" layoutY="382.0" prefHeight="25.0" prefWidth="80.0" /> 
         <ComboBox fx:id="homepartner_name" layoutX="8.0" layoutY="416.0" prefHeight="30.0" prefWidth="235.0" /> 
         <CheckBox fx:id="homepartner_gender1" layoutX="141.0" layoutY="456.0" mnemonicParsing="false" prefHeight="30.0" prefWidth="100.0" text="ذكر"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
         </CheckBox> 
         <CheckBox fx:id="homepartner_gender2" layoutX="8.0" layoutY="456.0" mnemonicParsing="false" prefHeight="30.0" prefWidth="100.0" text="أنثى"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
         </CheckBox> 
         <Label fx:id="current_cityaa" alignment="CENTER" layoutX="141.0" layoutY="490.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="100.0" text="المحافظة"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
         </Label> 
         <TextField fx:id="current_city" layoutX="8.0" layoutY="490.0" prefHeight="30.0" prefWidth="120.0" /> 
         <Label fx:id="current_cityaa1" alignment="CENTER" layoutX="141.0" layoutY="530.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="100.0" text="الحي"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
         </Label> 
         <TextField fx:id="current_suberb" layoutX="8.0" layoutY="530.0" prefHeight="30.0" prefWidth="120.0" /> 
         <TextField fx:id="prev_suberb" layoutX="11.0" layoutY="615.0" prefHeight="30.0" prefWidth="120.0" /> 
         <Label fx:id="current_cityaa11" alignment="CENTER" layoutX="144.0" layoutY="615.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="100.0" text="الحي"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
         </Label> 
         <Label fx:id="current_cityaa2" alignment="CENTER" layoutX="144.0" layoutY="575.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="100.0" text="المحافظة"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
         </Label> 
         <TextField fx:id="prev_city" layoutX="11.0" layoutY="575.0" prefHeight="30.0" prefWidth="120.0" /> 
        </children> 
        </AnchorPane> 
       <AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"> 
        <children> 
         <Label fx:id="formnumber" contentDisplay="RIGHT" layoutX="8.0" layoutY="14.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="174.0" text="رقم الاستمارة" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
          <padding> 
           <Insets left="50.0" /> 
          </padding> 
          <font> 
           <Font size="14.0" /> 
          </font> 
         </Label> 
         <Label fx:id="sectornumber" contentDisplay="RIGHT" layoutX="8.0" layoutY="48.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="174.0" text="رقم القطاع" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
          <padding> 
           <Insets left="50.0" /> 
          </padding> 
         </Label> 
         <Label fx:id="fathername" contentDisplay="RIGHT" layoutX="8.0" layoutY="82.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="174.0" text="اسم الأب" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
          <padding> 
           <Insets left="50.0" /> 
          </padding> 
         </Label> 
         <Label fx:id="fatherborn" contentDisplay="RIGHT" layoutX="20.0" layoutY="112.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="المواليد" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
          <padding> 
           <Insets left="50.0" /> 
          </padding> 
         </Label> 
         <Label fx:id="currentjob" contentDisplay="RIGHT" layoutX="20.0" layoutY="142.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="العمل الحالي" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
          <padding> 
           <Insets left="50.0" /> 
          </padding> 
         </Label> 
         <Label fx:id="previousjob" contentDisplay="RIGHT" layoutX="20.0" layoutY="172.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="العمل السابق" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
          <padding> 
           <Insets left="50.0" /> 
          </padding> 
         </Label> 
         <Label fx:id="fatherborn1" contentDisplay="RIGHT" layoutX="20.0" layoutY="244.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="المواليد" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
          <padding> 
           <Insets left="50.0" /> 
          </padding> 
         </Label> 
         <Label fx:id="currentjob1" contentDisplay="RIGHT" layoutX="20.0" layoutY="278.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="العمل الحالي" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
          <padding> 
           <Insets left="50.0" /> 
          </padding> 
         </Label> 
         <Label fx:id="fathername1" contentDisplay="RIGHT" layoutX="8.0" layoutY="208.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="174.0" text="اسم الأم" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
          <padding> 
           <Insets left="50.0" /> 
          </padding> 
         </Label> 
         <Label fx:id="previousjob1" contentDisplay="RIGHT" layoutX="20.0" layoutY="307.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="العمل السابق" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
          <padding> 
           <Insets left="50.0" /> 
          </padding> 
         </Label> 
         <Label fx:id="homepartner_sex" contentDisplay="RIGHT" layoutX="20.0" layoutY="451.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="الجنس" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
          <padding> 
           <Insets left="50.0" /> 
          </padding> 
         </Label> 
         <Label fx:id="homepartner_name" contentDisplay="RIGHT" layoutX="20.0" layoutY="414.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="الاسم" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
          <padding> 
           <Insets left="50.0" /> 
          </padding> 
         </Label> 
         <Label fx:id="partner_born" contentDisplay="RIGHT" layoutX="20.0" layoutY="378.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="الميلاد" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
          <padding> 
           <Insets left="50.0" /> 
          </padding> 
         </Label> 
         <Label fx:id="home_partner" contentDisplay="RIGHT" layoutX="8.0" layoutY="341.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="174.0" text="عدد المستضافين" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
          <padding> 
           <Insets left="50.0" /> 
          </padding> 
         </Label> 
         <Label alignment="CENTER" layoutX="8.0" layoutY="485.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="175.0" text="السكن الحالي"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
         </Label> 
         <Label alignment="CENTER" layoutX="8.0" layoutY="570.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="175.0" text="السكن الحالي"> 
          <font> 
           <Font size="14.0" /> 
          </font> 
         </Label> 
        </children> 
        </AnchorPane> 
       </items> 
      </SplitPane> 
     </children> 
     </Pane> 
     <SplitPane dividerPositions="0.4845360824742268" layoutX="8.0" layoutY="8.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="741.0" prefWidth="487.0"> 
     <items> 
      <AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0" /> 
      <AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" prefHeight="327.0" prefWidth="100.0" /> 
     </items> 
     </SplitPane> 
    </children> 
</AnchorPane> 
+0

嘗試起飛優選寬度和高度爲AnchorPane。如果可能的話,它將調整到這些規格。 –

+0

我不完全明白,是否希望錨窗格填充整個窗口,或窗口匹配屏幕大小,或錨窗格的大小匹配屏幕,無論窗口大小?從你的圖片中,東西看起來對我來說很好 – Gikkman

+0

當程序處於全屏模式時,他正試圖讓窗格調整大小。我不知道該怎麼做。我一直在擺弄它,沒有做任何事情。其他有經驗的人可以幫助你。 –

回答

0

這可以使用AnchorPane的這個屬性來完成:

AnchorPane.bottomAnchor 
AnchorPane.leftAnchor 
AnchorPane.rightAnchor 
AnchorPane.topAnchor 

但是,你需要決定什麼是場景的一部分會改變的,哪些不是。固定部分的寬度用prefWidth固定。 ha部分修復AnchorPane.leftAnchor或AnchorPane.rightAnchor給定固定部分的大小。

樣品:

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

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

<AnchorPane id="AnchorPane" prefHeight="600.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sanad.Entry_Page"> 
    <children> 
     <Accordion prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0"> 
     <panes> 
      <TitledPane animated="false" text="untitled 1"> 
      <content> 
       <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" /> 
      </content> 
      </TitledPane> 
      <TitledPane animated="false" text="untitled 2"> 
      <content> 
       <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" /> 
      </content> 
      </TitledPane> 
      <TitledPane animated="false" text="untitled 3"> 
      <content> 
       <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" /> 
      </content> 
      </TitledPane> 
     </panes> 
     </Accordion> 
     <SplitPane dividerPositions="0.5" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="200.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> 
     <items> 
      <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"> 
       <children> 
        <LineChart AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> 
        <xAxis> 
         <CategoryAxis side="BOTTOM" /> 
        </xAxis> 
        <yAxis> 
         <NumberAxis side="LEFT" /> 
        </yAxis> 
        </LineChart> 
       </children> 
      </AnchorPane> 
      <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"> 
       <children> 
        <TableView prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> 
        <columns> 
         <TableColumn prefWidth="75.0" text="C1" /> 
         <TableColumn prefWidth="75.0" text="C2" /> 
        </columns> 
        </TableView> 
       </children> 
      </AnchorPane> 
     </items> 
     </SplitPane> 
    </children> 
</AnchorPane> 
0

我嘗試做一些與此FXML,但我認爲這是壞的創建。你應該重建一切。對於正確的站點,最好使用GridPane而不是AnchorPane,並將所有元素放入網格中。 我在這個hobx中創建了HBox我把兩個AnchorPane,然後每個AnchorPane我把你的SplitPane。在這之後,你必須以這樣的AnchorPane的左右邊各SplitPane連接:

<SplitPane AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"> 

下面是這個FXML: 使用SceneBuilder預覽它是如何工作的。

<?xml version="1.0" encoding="UTF-8"?> 
<?import javafx.scene.text.*?> 
<?import javafx.geometry.*?> 
<?import java.lang.*?> 
<?import java.util.*?> 
<?import javafx.scene.*?> 
<?import javafx.scene.control.*?> 
<?import javafx.scene.layout.*?> 

<HBox id="AnchorPane" prefHeight="786.0" prefWidth="1024.0" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1"> 
    <AnchorPane prefHeight="200.0" prefWidth="200.0" HBox.hgrow="ALWAYS"> 
     <children> 
       <SplitPane dividerPositions="0.4845360824742268" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="741.0" prefWidth="487.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"> 
        <items> 
         <AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0" /> 
         <AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" prefHeight="327.0" prefWidth="100.0" /> 
        </items> 
       </SplitPane> 
     </children> 
    </AnchorPane> 
    <AnchorPane prefHeight="200.0" prefWidth="200.0" HBox.hgrow="ALWAYS"> 
     <children> 
       <SplitPane dividerPositions="0.5720620842572062" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="741.0" prefWidth="508.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"> 
        <items> 
         <AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" nodeOrientation="LEFT_TO_RIGHT"> 
          <children> 
           <TextField fx:id="formnumer_field" layoutX="8.0" layoutY="14.0" prefHeight="30.0" prefWidth="235.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="43.0" /> 
           <TextField fx:id="sectornumber_field" layoutX="8.0" layoutY="48.0" prefHeight="30.0" prefWidth="235.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="43.0" /> 
           <TextField fx:id="fathername_field" layoutX="8.0" layoutY="82.0" prefHeight="30.0" prefWidth="235.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="43.0" /> 
           <ComboBox fx:id="fatherborn_year" layoutX="8.0" layoutY="116.0" prefHeight="25.0" prefWidth="70.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="226.0" /> 
           <ComboBox fx:id="fatherborn_month" layoutX="85.0" layoutY="116.0" prefHeight="25.0" prefWidth="70.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="226.0" /> 
           <ComboBox fx:id="fatherborn_day" layoutX="162.0" layoutY="116.0" prefHeight="25.0" prefWidth="80.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="226.0" /> 
           <TextField fx:id="fathercurrentjob" layoutX="8.0" layoutY="145.0" prefHeight="30.0" prefWidth="235.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="72.0" /> 
           <TextField fx:id="fatherprevjob" layoutX="8.0" layoutY="179.0" prefHeight="30.0" prefWidth="235.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="72.0" /> 
           <TextField fx:id="mothername_field" layoutX="8.0" layoutY="215.0" prefHeight="30.0" prefWidth="235.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="72.0" /> 
           <TextField fx:id="mother_curr_job" layoutX="8.0" layoutY="278.0" prefHeight="30.0" prefWidth="235.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="72.0" /> 
           <ComboBox fx:id="motherborn_day" layoutX="162.0" layoutY="249.0" prefHeight="25.0" prefWidth="80.0" AnchorPane.rightAnchor="73.0" /> 
           <ComboBox fx:id="motherborn_year" layoutX="8.0" layoutY="249.0" prefHeight="25.0" prefWidth="70.0" /> 
           <TextField fx:id="mother_prev_job" layoutX="8.0" layoutY="312.0" prefHeight="30.0" prefWidth="235.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="72.0" /> 
           <ComboBox fx:id="motherborn_month" layoutX="85.0" layoutY="249.0" nodeOrientation="LEFT_TO_RIGHT" /> 
           <TextField fx:id="homepartner_num" layoutX="8.0" layoutY="346.0" prefHeight="30.0" prefWidth="235.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="72.0" /> 
           <ComboBox fx:id="homepartner_year" layoutX="11.0" layoutY="382.0" /> 
           <ComboBox fx:id="homepartner_month" layoutX="88.0" layoutY="382.0" /> 
           <ComboBox fx:id="homepartner_day" layoutX="163.0" layoutY="382.0" /> 
           <ComboBox fx:id="homepartner_name" layoutX="8.0" layoutY="416.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="72.0" /> 
           <CheckBox fx:id="homepartner_gender1" layoutX="141.0" layoutY="456.0" mnemonicParsing="false" prefHeight="30.0" prefWidth="100.0" text="ذكر"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
           </CheckBox> 
           <CheckBox fx:id="homepartner_gender2" layoutX="8.0" layoutY="456.0" mnemonicParsing="false" prefHeight="30.0" prefWidth="100.0" text="أنثى"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
           </CheckBox> 
           <Label fx:id="current_cityaa" alignment="CENTER" layoutX="141.0" layoutY="490.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="100.0" text="المحافظة" AnchorPane.rightAnchor="74.0"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
           </Label> 
           <TextField fx:id="current_city" layoutX="8.0" layoutY="490.0" AnchorPane.leftAnchor="8.0" /> 
           <Label fx:id="current_cityaa1" alignment="CENTER" layoutX="141.0" layoutY="530.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="100.0" text="الحي" AnchorPane.rightAnchor="74.0"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
           </Label> 
           <TextField fx:id="current_suberb" layoutX="8.0" layoutY="530.0" AnchorPane.leftAnchor="8.0" /> 
           <TextField fx:id="prev_suberb" layoutX="11.0" layoutY="615.0" AnchorPane.leftAnchor="11.0" /> 
           <Label fx:id="current_cityaa11" alignment="CENTER" layoutX="144.0" layoutY="615.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="100.0" text="الحي" AnchorPane.rightAnchor="71.0"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
           </Label> 
           <Label fx:id="current_cityaa2" alignment="CENTER" layoutX="144.0" layoutY="575.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="100.0" text="المحافظة" AnchorPane.rightAnchor="71.0"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
           </Label> 
           <TextField fx:id="prev_city" layoutX="11.0" layoutY="575.0" AnchorPane.leftAnchor="11.0" /> 
          </children> 
         </AnchorPane> 
         <AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"> 
          <children> 
           <Label fx:id="formnumber" contentDisplay="RIGHT" layoutX="8.0" layoutY="14.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="174.0" text="رقم الاستمارة" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
            <padding> 
             <Insets left="50.0" /> 
            </padding> 
            <font> 
             <Font size="14.0" /> 
            </font> 
           </Label> 
           <Label fx:id="sectornumber" contentDisplay="RIGHT" layoutX="8.0" layoutY="48.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="174.0" text="رقم القطاع" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
            <padding> 
             <Insets left="50.0" /> 
            </padding> 
           </Label> 
           <Label fx:id="fathername" contentDisplay="RIGHT" layoutX="8.0" layoutY="82.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="174.0" text="اسم الأب" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
            <padding> 
             <Insets left="50.0" /> 
            </padding> 
           </Label> 
           <Label fx:id="fatherborn" contentDisplay="RIGHT" layoutX="20.0" layoutY="112.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="المواليد" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
            <padding> 
             <Insets left="50.0" /> 
            </padding> 
           </Label> 
           <Label fx:id="currentjob" contentDisplay="RIGHT" layoutX="20.0" layoutY="142.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="العمل الحالي" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
            <padding> 
             <Insets left="50.0" /> 
            </padding> 
           </Label> 
           <Label fx:id="previousjob" contentDisplay="RIGHT" layoutX="20.0" layoutY="172.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="العمل السابق" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
            <padding> 
             <Insets left="50.0" /> 
            </padding> 
           </Label> 
           <Label fx:id="fatherborn1" contentDisplay="RIGHT" layoutX="20.0" layoutY="244.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="المواليد" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
            <padding> 
             <Insets left="50.0" /> 
            </padding> 
           </Label> 
           <Label fx:id="currentjob1" contentDisplay="RIGHT" layoutX="20.0" layoutY="278.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="العمل الحالي" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
            <padding> 
             <Insets left="50.0" /> 
            </padding> 
           </Label> 
           <Label fx:id="fathername1" contentDisplay="RIGHT" layoutX="8.0" layoutY="208.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="174.0" text="اسم الأم" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
            <padding> 
             <Insets left="50.0" /> 
            </padding> 
           </Label> 
           <Label fx:id="previousjob1" contentDisplay="RIGHT" layoutX="20.0" layoutY="307.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="العمل السابق" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
            <padding> 
             <Insets left="50.0" /> 
            </padding> 
           </Label> 
           <Label fx:id="homepartner_sex" contentDisplay="RIGHT" layoutX="20.0" layoutY="451.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="الجنس" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
            <padding> 
             <Insets left="50.0" /> 
            </padding> 
           </Label> 
           <Label fx:id="homepartner_name" contentDisplay="RIGHT" layoutX="20.0" layoutY="414.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="الاسم" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
            <padding> 
             <Insets left="50.0" /> 
            </padding> 
           </Label> 
           <Label fx:id="partner_born" contentDisplay="RIGHT" layoutX="20.0" layoutY="378.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="الميلاد" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
            <padding> 
             <Insets left="50.0" /> 
            </padding> 
           </Label> 
           <Label fx:id="home_partner" contentDisplay="RIGHT" layoutX="8.0" layoutY="341.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="174.0" text="عدد المستضافين" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
            <padding> 
             <Insets left="50.0" /> 
            </padding> 
           </Label> 
           <Label alignment="CENTER" layoutX="8.0" layoutY="485.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="175.0" text="السكن الحالي"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
           </Label> 
           <Label alignment="CENTER" layoutX="8.0" layoutY="570.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="175.0" text="السكن الحالي"> 
            <font> 
             <Font size="14.0" /> 
            </font> 
           </Label> 
          </children> 
         </AnchorPane> 
        </items> 
       </SplitPane> 
       <Pane blendMode="RED" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minWidth="-Infinity" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"> 
        <padding> 
         <Insets top="10.0" /> 
        </padding> 
       </Pane> 
     </children> 
    </AnchorPane> 
</HBox> 
+0

非常感謝你幫助我很多 – gems