Warning given for -fx-alignment: LEFT saying no enum constant javafx.geometry.Pos.LEFT

I am using an external css file called mainBut.cssto align the text of a JavaFX button,

Code for the button:

<Button fx:id="hostelBut"
        layoutX="7.0"
        layoutY="100.0"
        onAction="#hostelAction"
        prefHeight="30.0"
        prefWidth="150.0"
        styleClass="mainBut"
        stylesheets="@../resources/css/mainBut.css"
        text="Hostel">

File mainBut.css

.mainBut {
    -fx-background-color: #fdfdfd;
    -fx-alignment: LEFT;
    -fx-border-color: #bdc3c7;
}

When I compile this file and run it through NetBeans, I get the following warning.

WARNING: Caught java.lang.IllegalArgumentException: No enum constant javafx.geometry.Pos.LEFT' while calculating value for '-fx-alignment' from rule '*.mainBut' in stylesheet jar:file...

What can I do to fix this warning?

+4
source share
1 answer

LEFTis not a valid property value -fx-alignment. Valid Values:

[top left | top center | top right | center left | center | center right bottom left | lower center | bottom right | source left | base center | source-right]

Pos.

, center-left, .

+7

Source: https://habr.com/ru/post/1614127/


All Articles