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

Cannot animate a stage's opacityProperty with a transparent stage

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 8u60
    • fx2.0
    • javafx
    • None
    • Windows XP, JDK 1.6.0_23, JavaFX 2.0 beta #42

      I would like to open my main application window as slowly appearing. So I was trying to use Timeline to change stage's opacityProperty:

      timeline.getKeyFrames().addAll
      (
          new KeyFrame( Duration.ZERO, new KeyValue( stage.opacityProperty(), 0.1 ) ),
          new KeyFrame( new Duration( 1000 ), new KeyValue( stage.opacityProperty(), 1.0 ) )
      );
      stage.show();
      timeline.play();


      Unfortunately, there is no animation at all. I see window with start opacity value (0.1). On the other hand the actual opacity was changing and is 1.0. I can see it if force window redrawing. For example, by move mouse over the window. Looks like there is no stage repainting after changing stage.opacityProperty.

      To make sure I was trying to change window's height also. Something like this:

      timeline.getKeyFrames().addAll
      (
          new KeyFrame( Duration.ZERO, new KeyValue( stage.opacityProperty(), 0.0 ), new KeyValue( stage.heightProperty(), 0 ) ),
          new KeyFrame( new Duration( 1000 ), new KeyValue( stage.opacityProperty(), 1.0 ), new KeyValue( stage.heightProperty(), 700 ) )
      );

      This time it works fine. Both properties visually grows (height and opacity).

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

              Created:
              Updated:
              Resolved:
              Imported: