r/javahelp • u/[deleted] • Jun 11 '19
How do you structure a GUI?
In the past, I've always put all of the code into one class, but I know it's probably not the best thing to do. I can structure the logic of a program, but when it comes to the GUI, I'm stumped. How should one structure a GUI?
4
Jun 11 '19
Use the MVC architectural pattern. Also, SceneBuilder has a neat and easy way of generating user interfaces using FMXL. It'll be down to creating the data models of your application and linking the controller to the UI.
2
4
u/blastemRebelScum Jun 11 '19
JavaFX is the API used to structure a GUI. Check out JavaFX documentation at https://docs.oracle.com/javafx/2/
2
13
u/lbkulinski Jun 11 '19
I suggest looking into the MVC pattern.