title: How to define Stage in FXML?
body: <p>I want to define my GUI entirely in FXML. I started with JavaFX templates that are shown everywhere from Oracle docs to Netbeans templates.
  In these templates there is no Stage defined in FXML, just the actual Scene with UI controlls in it. Something like:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;?import java.lang.*?&gt;
  &lt;?import java.util.*?&gt;
  &lt;?import javafx.scene.*?&gt;
  &lt;?import javafx.scene.control.*?&gt;
  &lt;?import javafx.scene.layout.*?&gt;
  
  &lt;AnchorPane id="AnchorPane" prefHeight="200" prefWidth="320" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fxskuska.FXMLDocumentController"&gt;
      &lt;children&gt;
          &lt;Button layoutX="126" layoutY="90" text="Click Me!" onAction="#handleButtonAction" fx:id="button" /&gt;
          &lt;Label layoutX="126" layoutY="120" minHeight="16" minWidth="69" fx:id="label" /&gt;
      &lt;/children&gt;
  &lt;/AnchorPane&gt;
  </code></pre>
  
  <p>That seemed okay, until the first thing I wanted to change - to set the window's name. That's when I realized Scene is not a Window (or a JFrame analogy), but Stage is.
  When I tried to wrap all this inside a  element, I couldn't set the <code>fx:controller</code> attribute to the AnchorPane, because it is not a root element anymore. I even tried to "outsource" it by using <code>fx:include</code> in the Stage file, but that just gave me an "Unexpected closing tag:scene" error.</p>
  
  <ol>
  <li>How to define Stage in FXML?</li>
  <li>Is Stage the JFX analogy of JFrame?</li>
  </ol>