Forums Register Login

Submitting form data to a new screen using javafx

+Pie Number of slices to send: Send
I'm currently working on a desktop app using javafx. IN the introductory screen, I have a form where the user would fill in various information, and then submit the form contents to a new screen, discarding the old screen as the user would not be heading back there in the application logic flow. However I'm at a loss as to how this would be done. I was thinking it would be like Android where I could call a get new screen function, calling the class for the new screen's constructor and it'd pass over to there, but when trying that, it just created a new window, which obviously isn't what I'm after. Was wondering if anyone knew of a better way that I could move the application to a new screen, and still easily pass the form information over to that screen for further processing.
+Pie Number of slices to send: Send
I think this question is (essentially) a duplicate of another coderanch question:

switch between scenes (not stage) in javafx

Have a look over the links in the answers to that question and see if it answers your question.

+Pie Number of slices to send: Send
I would use FXML and make multiple scenes. If you are not to sure on how to handle multiple scenes, I would suggest you goto the following two links and read over them.

Angela's Blog
getting started with javafx


I myself made a login screen based somewhat on those codes as well as another one that I cant remember at the moment, but how I went about it is as follows...

Key parts in my main class are




This is only part of the code I have used and is also only from my main class, but what I have done is when the program starts it does the gotoLogin first. The login screen's controller is made aware of the main screen via the method shown in Angela's blog, and when a user successfully logs in the controller calls on the main screen's method of gotoClientHome and pass it a user object. In your case you would be passing the information that the user had entered.
You're not going crazy. You're going sane in a crazy word. Find comfort in this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 14996 times.
Similar Threads
Non Struts App -> Struts App - use splash screen and auto forward?
MVC & Swing - How model classes work together ?
Opening a new browser window from the applet and supplying data via POST
Passing data from jsp to jsp
Having forms and tables in success page and send it to action class on submit ?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 04:46:45.