Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use MigLayout with FXML? #69

Open
wimdeblauwe opened this issue Jul 9, 2019 · 5 comments
Open

How to use MigLayout with FXML? #69

wimdeblauwe opened this issue Jul 9, 2019 · 5 comments

Comments

@wimdeblauwe
Copy link

Is there a way to use MigLayout in an FXML file and specify the constraints?

<MigPane xmlns="http://javafx.com/javafx"
         xmlns:fx="http://javafx.com/fxml"
         fx:controller="com.company.project.login.LoginScreenController"
>
    <layoutConstraints>
<!-- How to specify constraints here? -->
    </layoutConstraints>
    <rowConstraints>

    </rowConstraints>
    <columnConstraints>

    </columnConstraints>
...
</MigPane>
@tbee
Copy link
Collaborator

tbee commented Jul 9, 2019 via email

@wimdeblauwe
Copy link
Author

Thank you! Would be great if this was in the documentation somewhere.

@wimdeblauwe
Copy link
Author

I just tried the example, but I get errors.

If I do something like:

<TextField fx:id="usernameField" MigPane.cc="growx, wrap"/>

I get:

com.sun.javafx.fxml.PropertyNotFoundException: Static property "cc" does not exist or is read-only.

If I do:

<MigPane xmlns="http://javafx.com/javafx"
     xmlns:fx="http://javafx.com/fxml"
     rows="wrap"
>

I get:

com.sun.javafx.fxml.PropertyNotFoundException: Property "rows" does not exist or is read-only.

I am using MigLayout 5.2

@tbee
Copy link
Collaborator

tbee commented Jul 10, 2019 via email

@wimdeblauwe
Copy link
Author

Thanks, I was using the wrong import indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants