0

I'm working on polishing up an assignment. I am working with JavaFX and have 3 sequential scenes. The data from the first and second scenes is used in the third scene and consists of various types of inputs, all converted to String data to populate this third scene. Problem is, the only way I've been able to get it to work is to make an event handler, in this case a button. The appropriate data loads right up and everything is technically accurate, but I think having a button to press to load up the output data right after having pressed the button on the previous page to submit the data is kind of clunky.

Is there any way to make the elements I have set up to display the data automatically load the data in a non-clunky way? I thought about adding a mouse event to just watch for mouse movement, but that would potentially be kind of wonky if someone who doesn't fidget with their mouse were to run the program.

The only solution I've made actually work so far is to create a button and make the event for clicking the button load populate the data.

Thanks in advance!

Jamith NImantha
  • 1,999
  • 2
  • 20
  • 27
shuvool
  • 3
  • 3
  • 5
    Showing what you've already tried, preferably in the form of a [mcve], would let people address your problem more specifically. Code also explains what's happening much more clearly than words. – Slaw Apr 29 '19 at 08:03
  • If I understand your question correctly you simply want to pass parameters to the controller of the third scene, and make it so that your third scene is populated and updated before being shown. There are plenty of answers on this site covering this. Some are old, but gold, and does still work fine or will at least give you an idea of how you do it. For example, observe how the user id is passed to the controller for the stage, before the stage is shown in the answer here: https://stackoverflow.com/questions/14370183/passing-parameters-to-a-controller-when-loading-an-fxml?noredirect=1&lq=1 – Robert Apr 29 '19 at 09:06

0 Answers0