title: JPanel.getGraphics equivalent in JavaFx to use with OpenCV
body: <p>The title seems a little bit confusing, but I'll explain everything.</p>
  
  <p>I'm developing a project where I show the image captured by a webcam in a JPanel, Java Swing. Now I have to integrate this with JavaFx.
  I have a controller where I have the method startRecording, that would initialize the cameraThread and tell the class Camera to startRecording, inside Camera class a have a method DrawFrame(BufferedImage, JPanel panel) where I call the function drawImage from OpenCV to draw in the Panel:</p>
  
  <p>Controller:</p>
  
  <pre><code>public void startRecording(){
      cameraInstance.setCameraRGBPanel(windowsInstance.getCameraRGBPanel());
      cameraInstance.setCameraHSVPanel(windowsInstance.getCameraHSVPanel());
      cameraInstance.setCameraThresholdPanel(windowsInstance.getCameraThresholdPanel());
      cameraInstance.setRecord(true);
      cameraThread = new Thread(cameraInstance);
      cameraThread.start();
  }
  </code></pre>
  
  <p>Class camera:</p>
  
  <pre><code>private void drawFrame(BufferedImage buff, JPanel pane){
      pane.getGraphics().drawImage(buff, 0, 0, null);
  }
  </code></pre>
  
  <p>To start with, JavaFX has no JPanel and the Pane (an option) has no getGraphics, I've tried to use a SwingNode, add the JPanel and then do everything as usual, but the image simply won't be shown.</p>
  
  <p>The following code was a test, that's why it seems to be so 'bad'.</p>
  
  <pre><code>public void start(Stage stage) throws Exception {
  
      stage.setTitle("Tela Teste");
  
      pCamera = new Pane();
      SwingNode swing = new SwingNode();
      pCamera.getChildren().add(swing);
      createAndSetSeingContent(swing);
  
      Group root = new Group();
      root.getChildren().add(pCamera);
      stage.setScene(new Scene(root , 500, 500));
      stage.setResizable(true);
      stage.show();
  }
  
  private void createAndSetSeingContent(SwingNode swing) {                
      ControllerCamera control = new ControllerCamera();
      System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
  
      JPanel panel = new JPanel();
      JLabel label = new JLabel("Abc");
      //panel.add(label);
      swing.setContent(panel);
  
      Button teste = new Button("A");
      pCamera.getChildren().add(teste);
      teste.setOnAction(new EventHandler&lt;ActionEvent&gt;() {
  
          @Override
          public void handle(ActionEvent event) {
              control.startRecording(panel);
              System.out.println("abc");
          }
      });
  }
  </code></pre>
  
  <p>I changed to method startRecording to something like:</p>
  
  <pre><code>public void startRecording(JPanel panel){
      cameraInstance.setCameraRGBPanel(panel);
      cameraInstance.setRecord(true);
      cameraThread = new Thread(cameraInstance);
      cameraThread.start();
  }
  </code></pre>
  
  <p>Still nothing appears in the panel, but if I add a label or button, then it appear and works as intended to. The "abc" is always shown in the console.</p>
  
  <p>I think that's all the code related to the problem. Something else I want to say is that yesterday was the first day I was dealing with FX, let's say the project is divided, the other guy is also working on the problem, but we haven't gotten anywhere so far, that's why I decided to ask you here.</p>
  
  <p>Edit 1: everything was working perfectly before all this situation (everything works with Swing, but not in FX).</p>