r/javahelp • • 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?

24 Upvotes

7 comments sorted by

13

u/lbkulinski Jun 11 '19

I suggest looking into the MVC pattern.

3

u/[deleted] Jun 11 '19

Thank you, I will!

2

u/[deleted] Jun 12 '19

I apologize for tailgating my question but are there any good blog post or YouTube talk about MVC pattern with node or react js frameworks?

4

u/[deleted] 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

u/[deleted] Jun 11 '19

Thank you!

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

u/[deleted] Jun 11 '19

Thank you!