Skip to content

Tag: fxml

How to change this JavaFX into using a ControllerFactory

I have looked into using ControllerFactory a lot, to allow this code to be instantiated from a database, and have cross-controller compatibility. But with my original setup different from others I found online, I found it extremely hard to follow along, and use what would fit into my program from theirs. Any …

How show or hide images in condition with javafx

I need help to program a windows based application with JavaFX. I simply want to show or hide some images with if/else condition. what I exactly want is something like this: if x=1 then show image1 if x=2 them show image2 I tried setvisible() and setDisable() methodes to do this, but it doesn’t work. an…

Bind StringProperty to Label from a Singleton

I have a singleton called MenuText. It is responsible for displaying the correct text in the menu. It gets updated dynamically. I have a fxml file, but the MenuText can’t have a reference to it. (This would contradict the MVVM architectural style) Initially I used <fx:define> to setup a reference …

GridPane: How to position a Label top-left?

How can I position the Label Label 1 at the top-left position of the cell? I tried to set the alignment of the label accordingly, but this didn’t do the trick. d Answer You need to modify the first RowConstraints and set the valignment property to VPos.TOP. The vertical alignment for the row. If set, wi…