Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8097443

JavaFX components do not render (GPU interference)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 7u51
    • javafx
    • None
    • Windows 7, NVIDIA Quadro FX 3800

      I apologize in advance for this probably being hard to reproduce, but I thought it was important to report anyway.

      I've recently found that, when using Windows, JavaFX components, be it on their own or embedded in Swing, simply stop rendering when Avid Media Composer (v7.0.2) is running alongside the Java application. The components are still there in the sense that they react to mouse and keyboard input, but nothing is shown.
      I initially assumed that this was some sort of issue with the graphics card or driver.

      When using JavaFX embedded within Swing, the following exception is raised:
      RenderJob.run: internal exception
      java.lang.NullPointerException
              at com.sun.javafx.tk.quantum.EmbeddedPainter.validateStageGraphics(Unknown Source)
              at com.sun.javafx.tk.quantum.EmbeddedPainter.run(Unknown Source)
              at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
              at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
              at com.sun.prism.render.RenderJob.run(Unknown Source)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
              at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(Unknown Source)
              at java.lang.Thread.run(Unknown Source)

      What really caused me to report this is that exchanging the jfxrt.jar from the Windows distribution with the one from MacOS causes the issue to disappear entirely, which makes me think that this actually is not an issue with AMC or the graphics card/driver, but the Windows distribution of JavaFX.

      My testcode used for JavaFX/Swing:

      import java.awt.BorderLayout;
      import java.io.File;

      import javafx.application.Platform;
      import javafx.embed.swing.JFXPanel;
      import javafx.scene.Group;
      import javafx.scene.Scene;
      import javafx.scene.media.Media;
      import javafx.scene.media.MediaPlayer;
      import javafx.scene.media.MediaView;

      import javax.swing.JFrame;

      public class Main extends JFrame {

      public static void main(final String[] args) {
      if (args.length != 1) {
      System.out.println("Wrong argument count");
      System.exit(1);
      }
      final Main main = new Main();
      main.setVisible(true);

      Platform.runLater(new Runnable() {
      @Override
      public void run() {
      main.getMediaPlayer(main.getPanel(), new File(args[0]).toURI().toString());
      }
      });

      }

      JFXPanel panel;

      public JFXPanel getPanel() {
      return panel;
      }

      public Main() {
      setSize(613, 344);

      panel = new JFXPanel();
      getContentPane().add(panel, BorderLayout.CENTER);

      }

      MediaPlayer mediaPlayer;

      public void getMediaPlayer(JFXPanel fxPanel, String uri) {

      if (mediaPlayer != null) {
      mediaPlayer.stop();
      mediaPlayer.dispose();

      }

      mediaPlayer = new MediaPlayer(new Media(uri));

      mediaPlayer.setAutoPlay(true);

      MediaView mediaView = new MediaView(mediaPlayer);

      Group root = new Group();
      Scene scene = new Scene(root, 613, 344);

      root.getChildren().add(mediaView);

      fxPanel.setScene(scene);
      scene.setFill(javafx.scene.paint.Color.TRANSPARENT);

      mediaView.setFitHeight(344);
      mediaView.setPreserveRatio(true);

      }
      }

            vadim Vadim Pakhnushev
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: