Answer the question
In order to leave comments, you need to log in
How to make a GUI in Java?
I am studying JavaFX and the following question arose : The location of elements for the GUI can be written either in an FXML file, or everything can be programmed directly in Java code. How to develop a GUI correctly ?
At first I thought that it was better to write the layout in FXML, and the logic in Java code, but now this approach seems to me not very convenient.
Answer the question
In order to leave comments, you need to log in
not habitual. but not comfortable. description of the form separately, logic separately, css styles separately brings benefits when you need to change the program many, many times. Then you understand how convenient the separation of these things is. This separation gives flexibility.
I agree with all the unsubscribed guys here. As an example, take the same Android: there you can also build layout on XML, or programmatically. By default, they are done in XML, in Java only when necessary.
I think the same approach is very applicable to JavaFX desktop applications.
Well, I repeat: it is much more convenient to separate logic and presentation.
Of course, the interface must be built from FXML pieces. This is very convenient and will save a lot of time when accompanied.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question