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);
}
}
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);
}
}
- relates to
-
JDK-8094276 WinApi User32.sendMessage HWND_BROADCAST
-
- Closed
-