I have a button that generates another button each time it’s clicked. 1 of the problems is, that the generated button is placed in the wrong location. The buttons should start around the Top Left side of the window, but the location of the buttons is at the bottom left of the window. I can’t use t…
Tag: fxml
JavaFX – how to display values of two table columns in TableView with different order from one ObservableList?
University student here currently working on a tournament application project, and I’ve got this current issue with GUI: My matchmaking algorithm takes the player’s numbers and matches the lowest number with the highest, for example if we have 8 players then we will have; P1 vs P8, P2 vs P7 and so…
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 …
Is there a way to check for a right mouse button click in FXML?
I am building a version of Risk in JavaFX with FXML for school. Now we want to be able to right click a button to decrease the amount of troops in a country and left click it to increase the amount. The left click was pretty self explanatory as it is just an onAction, but how would we check for
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…
Java project can display a new scene pretty easily, but only for certain JavaFXML files, how to fix this?
Here’s my code I’m struggling with (I marked the line that’s giving me errors): At this point, it does exactly what I want it to do, it loads a new scene of “CreateAccount.fxml” file whenever I click the login button. But I want it to load a different FXML file, so I change the n…
Javafx- how this multiple toggle buttons (in one group) actions are correctly configure for my need
This is what happens. But i need to return colors when i press other toggle buttons What I need to do is colors need to be back to blue after clicking on another button (while toggling another button need to untoggle toggled buttons) Problem is when I toggle 1st button (working correctly – changing colo…
How can I assign a value to my GUI attributes from a custom object? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question I am trying to make a game similar to bitlife, and in my program the first scene is the main…