J
J
Junior0072017-10-15 22:18:16
Java
Junior007, 2017-10-15 22:18:16

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

4 answer(s)
S
Sergey, 2017-10-15
@red-barbarian

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.

R
ruslanys, 2017-10-19
@ruslanys

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.

S
Sergey Gornostaev, 2017-10-15
@sergey-gornostaev

It is better to separate logic and presentation.

A
Andrey Goncharov, 2017-10-18
@andre_goncharov

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 question

Ask a Question

731 491 924 answers to any question