palexdev / MaterialFX

A library of material components for JavaFX
GNU Lesser General Public License v3.0
1.21k stars 122 forks source link

Maven v1.14.0 gives buggy UI, but v11.14.0-EA3 does not #297

Closed Ilirski closed 1 year ago

Ilirski commented 1 year ago

Describe the bug

Hi, I'm new to Java, JavaFX, and Maven in general so please excuse any mistakes I make.

I copy the code from README.md and added it to my Maven pom.xml,

<dependency>
    <groupId>io.github.palexdev</groupId>
    <artifactId>materialfx</artifactId>
    <version>11.14.0</version>
</dependency>

and I add the following scene and call .show() on it.

    private Scene createTestScene() {
        VBox vBox = new VBox();
        MFXPasswordField usernameTextField = new MFXPasswordField() {{
            setFloatingText("Inline mode");
        }};
        MFXButton mfxButton = new MFXButton("Submit") {{
            setTextFill(Color.WHITE);
            setButtonType(ButtonType.RAISED);
            setBackground(Background.fill(Color.PURPLE));
        }};
        vBox.getChildren().add(usernameTextField);
        vBox.getChildren().add(mfxButton);
        return new Scene(vBox);
    }

I get a broken MFXPasswordField: image

However when I use version 11.14.0-EA3 instead (which I took from here,

The MFXPasswordField works as expected: image

Also, I'm new to Maven so I may be mistaken, but the date for the 1.14.x version looks weird to me (why 2022?) image

palexdev commented 1 year ago

It's not working because you didn't read the release notes, neither the updated README ;)

As for the versions, EA releases stand for Early Access, those two releases come from the staging, and it was intended to be the actual v11.14.0 once completed. I had not enough time to end development though

Ilirski commented 1 year ago

Ah I see. So I needed to add

MFXThemeManager.addOn(scene, Themes.DEFAULT, Themes.LEGACY);

for it to be able to show properly. I thought it was a problem with the versions since I couldn't find it on mvnrepository, but turns out it was a problem with me lacking reading skills. Thanks a lot and apologies for the mistake.