I'm attempting to build a simple proof of concept program using SceneBuilder and FXML, consisting of two screens. The first screen is just a text field and a button that takes you to the second screen, and the second screen has just a label that, ideally, will display whatever was inside of the text field when the button was hit. Each screen has its own FXML file and it's own controller. I've read up, down, and sideways about FXMLLoader, as my research points to that being the ideal way to get this done, but I still cant seem to discern how to properly use it. Ultimately I'd like to implement this in a sort of "character creation" pre-game screen for a role playing game, where the players stat rolls/inventory choices are moved from the initial screen to either a model for calculating/processing, or to the second screens controller for display.
相关问题
- I get an exception when trying to swap elements in
- JFX scale image up and down to parent
- Dragging an undecorated Stage in JavaFX
- JavaFX sample issue
- How to change the font size in ListView in JavaFX?
相关文章
- Low quality icon in taskbar of a Stage. JavaFX
- Loading custom font using JavaFX 8 and css
- Javafx Platform.runLater never running
- JavaFX scrolling table update performance degrades
- How to change the color of pane in javafx?
- Javafx select multiple rows
- Escape from a Number TextField in a JavaFX dialog
- How to merge cells in JavaFX Scene builder?
Okay, this is an answer of sorts, bear with me, I found a video by a one Sahil Huseynzade that I think finally made this click for me. I was thinking that I could use FXMLLoader as almost an import of sorts, that I could somehow use during the creation of my controller in order to access other controllers at will. I've copied below some code I got working with an FXMLLoader, with some comments pertaining to how I think FXMLLoader is working. Sorry if the explanations are obtuse or poorly worded from a technical standpoint, or if I've been a general novice/dunce throughout all of this. I did have a further question though, I expect that it's bad form to ask it within an answer, is there a way to make it so that information is updated dynamically across windows? Like could I have one window have a dice rolling button, who's results appear on another window automatically?