Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.