title: Adding children to JavaFX Control/Parent classes
body: <p>Added children used to be visible in all my subclasses, like in the example here.</p>
  
  <p>Due to some recent changes I made (in a big porting of very old Java SWING code) children are still visible in <code>TextField</code> or <code>TextArea</code>, for example, but not in <code>Button</code>(ish) controls, even though additions are in the list.</p>
  
  <p>Obviously, I don't understand the policy governing the addition of children. Any ideas?</p>
  
  <pre><code>public class QButton extends Button  {
      ...
      public QButton(String str) {
          ...
          ObservableList&lt;Node&gt; children = getChildren();
          System.out.println("Children: " + children);
  
          Rectangle rect = new Rectangle(0., 0., 200., 200.);
          rect.setStroke(Color.RED);
          rect.setFill(Color.TRANSPARENT);
          rect.setStrokeWidth(2);
          getChildren().add(rect);
          rect.setVisible(true);
  
          children = getChildren();
          System.out.println("Children: " + children);
      }
      ...
  </code></pre>