title: Can't show an instance of an inherited Node class
body: <pre><code>public void start(Stage primaryStage) {
      Figure figure = new Figure(50,50,100,100,400,400);
      GridPane pane = new GridPane();
      pane.getChildren().addAll(figure);
  
      Scene scene = new Scene(pane,500,700);
  
      primaryStage.setTitle("Main");
      primaryStage.setScene(scene);
      primaryStage.show();
  }
  
  
  public class Figure extends Node {
  private Circle circle ;
  private Line boldLine ;
  private Line thinLine ;
  private Line prepenLine ;
  
  public Figure(int centerX, int centerY, int startX, int startY, int endX, int endY){
      Circle circle = new Circle(centerX,centerY,10);
      circle.setStroke(Color.GRAY);
      circle.setFill(Color.DARKGRAY);
     prepenLine = new Line(startX,startY,endX,endY);
  }
  </code></pre>
  
  <p>Hi, I was trying to write a class to use my custom nodes like a combo of line and circle but an error keep occuring in show() statement. 
  I can't find what is wrong with the code. Any advice?</p>
  
  <p>Edit: provided errors to make it more clear</p>
  
  <pre><code>Exception in thread "JavaFX Application Thread" java.lang.UnsupportedOperationException: Applications should not extend the Node class directly.
      at javafx.graphics/com.sun.javafx.scene.NodeHelper.getHelper(NodeHelper.java:78)
      at javafx.graphics/com.sun.javafx.scene.NodeHelper.transformsChanged(NodeHelper.java:121)
      at javafx.graphics/javafx.scene.Node.nodeResolvedOrientationInvalidated(Node.java:6540)
      at javafx.graphics/javafx.scene.Node.parentResolvedOrientationInvalidated(Node.java:6517)
   etc.
  </code></pre>