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

Java Swing application hangs when embedding a video scene.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 7u15
    • Fix Version/s: 8
    • Component/s: javafx
    • Environment:

      Windows 7 Profressional, Service Pack 1

      java version "1.7.0_17"
      Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
      Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

      Description

      After embedding a video inside a standalone Java Swing application with JavaFX media. I found that three different threads (AWT-Queue, JavaFX application thread and QuantumRenderer) are being calling the repaint routine on the JFXPanel causing the application to hang. I have solved this problem by validating when the repaint method is called from AWT and QuantumRenderer, and queuing it into the JavaFX thread.

      Here is the snipped:

          @Override
          public void repaint(final long tm,
                  final int x,
                  final int y,
                  final int width,
                  final int height) {
              log.log(Level.INFO,"repaint(long, int, int, int, int)");
              if(Platform.isFxApplicationThread()) {
                  super.repaint(tm, x, y, width, height);
              } else {
                  Platform.runLater(new Runnable() {
                      
                      @Override
                      public void run() {
                          JFXVideoPanel.super.repaint(tm, x, y, width, height);
                      }
                  });
              }
          }

        Attachments

          Activity

            People

            • Assignee:
              ant Anton Tarasov
              Reporter:
              duke J. Duke (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: