Dhinesh Rdk
Dhinesh Rdk

Reputation: 11

Class does not exist Insets in java 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>

I get an error in GridPane padding Insets on this line:

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

Upvotes: 1

Views: 2081

Answers (1)

PILABRE MIKAILA
PILABRE MIKAILA

Reputation: 81

If your error is class not found error, you can add this import statement at the beginning of your FXML file.

<?import javafx.geometry.Insets?>

Upvotes: 1

Related Questions