Im a bit of a new guy to JavaFx, I understand how to use IDs in Scene Builder and then to connect them to my IDE (intellij). For example, I am working on a Wheel of Fortune GUI, which I have already written the logic for. When the user clicks the 'Create Account' Button, I understand how to take information entered into UserName TextField and manipulate it but how do i print what the user entered back onto the primaryStage?
For example, lets say you enter your username (BOB) into the username textfield. After retrieving what you entered, I want to print out on the Stage "It is Bob's Turn" in nice big letters. How can I go about doing this?
Thanks
Vi_ral
Asked
Active
Viewed 301 times
0

Varun Rao
- 39
- 6
-
Write a constructor for your class retrieving primary stage or a label on primary stage, and manipulate it in your logic. – Steven Jan 23 '16 at 23:20
-
Possible duplicate of [Passing Parameters JavaFX FXML](http://stackoverflow.com/questions/14187963/passing-parameters-javafx-fxml) Just combine it with the observer pattern or do something similar, like create a property binding. – fabian Jan 23 '16 at 23:49
-
It's not really clear what the issue is. You said you know how to connect the FXML to the controller code. Once you have the data in properties in a Java object, you just pass values to methods or call methods returning values in the usual way. You should create a simple example which shows where you are stuck, and [edit] your question to include it. See [How do I ask a good question](http://stackoverflow.com/help/how-to-ask) and How to create a [MCVE]. – James_D Jan 24 '16 at 02:17