-
Notifications
You must be signed in to change notification settings - Fork 76
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
Comments
Yes there is. The JavaFX version contains some tests showing how to do that: specify MigPane.cc as an attribute.
https://github.com/mikaelgrev/miglayout/blob/master/javafx/src/test/resources/MigPaneTest8.xml
…On 9-7-2019 15:47, Wim Deblauwe wrote:
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> |
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#69?email_source=notifications&email_token=AAK5BQVNIRRZ2YMMTJBT7ZTP6SJIDA5CNFSM4H7FWVC2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G6DNI4A>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAK5BQTPRV6G4JJWSG35QGTP6SJIDANCNFSM4H7FWVCQ>.
|
Thank you! Would be great if this was in the documentation somewhere. |
I just tried the example, but I get errors. If I do something like:
I get:
If I do:
I get:
I am using MigLayout 5.2 |
Make sure the correct version of MigPane is included. There is are two, the one in the fxml subpackage contains extentions needed to be used in fxml.
<?importorg.tbee.javafx.scene.layout.fxml.*?>
…On 10-7-2019 16:24, Wim Deblauwe wrote:
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
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#69?email_source=notifications&email_token=AAK5BQSP4K66QATJXFITPMLP6XWIRA5CNFSM4H7FWVC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZTUBQY#issuecomment-510083267>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAK5BQQNWGXCBADAX22NW6LP6XWIRANCNFSM4H7FWVCQ>.
|
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
Is there a way to use MigLayout in an FXML file and specify the constraints?
The text was updated successfully, but these errors were encountered: