user3734011
user3734011

Reputation: 15

JavaFX LoadException while loading fxml-file

Im trying to use fxml and JavaFX for my application. But when the fxmlLoader load my file, i receive the following error:

javafx.fxml.LoadException: Font is not a valid type.

I really do not understand why. In a other Interface I use exactly the same label. the fxml code of the used label:

<Label fx:id="blueLabel" alignment="CENTER" maxWidth="Infinity"
       prefHeight="10.0" textFill="#054682" BorderPane.alignment="CENTER">
    <font>
        <Font size="1.0" />
    </font>
</Label>

I hope you can help me. Thanks a lot

Upvotes: 1

Views: 1349

Answers (1)

Uluk Biy
Uluk Biy

Reputation: 49185

Import the Font as

<?import javafx.scene.text.Font?>

or with wildcard

<?import javafx.scene.text.*?>

in the FXML file.

Upvotes: 4

Related Questions