In every example I have seen yet almost all of the GUI code is written in the start(Stage stage)
method of the main class. Is this the best approach, or is it OK to subclass the Stage class and make your own thing? If the latter is OK, wouldn't the performance suffer because of lot of Stages?
Asked
Active
Viewed 1,132 times
3

verin
- 31
- 2
1 Answers
1
You have to use stage
given to start
method as your main Stage because it's created for you by JavaFX startup logic (and it can be desktop stage, jnlp one, or a plugin in the browser so you better not create it yourself).
If you need another windows in your application (dialogs, warning, popup windows, etc) you can create new Stages. You can use them as new Stage()
objects or subclass, at doesn't really matter or affect performance (IMHO).

Sergey Grinev
- 111
- 3