类不存在java fxml中的insets

时间:2016-09-15 13:09:48

标签: javafx javafx-8 fxml

<AnchorPane id="AnchorPane"  styleClass="mainFxmlClass" xmlns:fx="http://javafx.com/fxml" fx:controller="freshminds.DashBoardController">
    <stylesheets>
        <URL value="@dashboard.css"/>
    </stylesheets>
    <Button layoutX="40" layoutY="30"  text="DASHBOARD"  fx:id="btn_dashboard" />
    <GridPane fx:id="dash_grid"  layoutX="40" layoutY="300" alignment="center" hgap="10" vgap="10" xmlns:fx="http://javafx.com/fxml">
    <padding><Insets top="25" right="25" bottom="10" left="25"/></padding>        

        <Button   text="SERVICE  PACKAGE"  fx:id="btn_service" />
         <Button   text="BOOKING"  fx:id="btn_booking" />
          <Button   text="INVOICE"  fx:id="btn_invoice" />
          <Button   text="REPORTS"  fx:id="btn_reports" />
          <Button   text="COUPONS"  fx:id="btn_coupons" />
          <Button   text="SOCIAL MEDIA"  fx:id="btn_social" />

    </GridPane> 
</AnchorPane>

我在此行的GridPane填充Insets中收到错误:

<padding><Insets top="25" right="25" bottom="10" left="25"/></padding>

1 个答案:

答案 0 :(得分:0)

如果您的错误是找不到类错误,您可以在FXML文件的开头添加此import语句。

<?import javafx.geometry.Insets?>