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

Controls don't display properly if they are enabled after having been disabled

XMLWordPrintable

      In the following test case, when using the JavaFX SDK 1.2 partner binaries dated April 29, 2009:
      (Note: This is same code as RT-4437)

      package projavafx.metronometransition.ui;
      import javafx.animation.Interpolator;
      import javafx.animation.Timeline;
      import javafx.animation.transition.TranslateTransition;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.shape.Circle;
      import javafx.scene.layout.Flow;
      import javafx.scene.paint.Color;
      import javafx.stage.Stage;

      var circle:Circle;
      var anim = TranslateTransition {
        duration: 1s
        node: bind circle
        fromX: 0
        toX: 200
        interpolator: Interpolator.LINEAR
        autoReverse: true
        repeatCount: Timeline.INDEFINITE
      };

      Stage {
        title: "Metronome using TranslateTransition"
        width: 400
        height: 500
        visible: true
        scene: Scene {
          content: [
            circle = Circle {
              centerX: 100
              centerY: 50
              radius: 4
              fill: Color.BLUE
            },
            Flow {
              layoutX: 50
              layoutY: 420
              hGap: 10
              //hAlign: javafx.geometry.HPos.CENTER //TODO: Remove layoutX when this is available
              content: [
                Button {
                  text: "Start"
                  disable: bind anim.running
                  action: function():Void {
                    anim.playFromStart();
                  }
                },
                Button {
                  text: "Pause"
                  disable: bind anim.paused or not anim.running
                  action: function():Void {
                    anim.pause();
                  }
                },
                Button {
                  text: "Resume"
                  disable: bind not anim.paused
                  action: function():Void {
                    anim.play(); //TODO: This doesn't seem to be working
                  }
                },
                Button {
                  text: "Stop"
                  disable: bind not anim.running
                  action: function():Void {
                    anim.stop();
                  }
                }
              ]
            }
          ]
        }
      }

      Instead of having a grayed-out appearance, the Buttons that are disabled look normal, but don't have the rollover behavior that an enabled button has. After clicking the Start button, and then the Stop button, the disabled buttons take on a grayed-out appearance.

      Thanks,
      Jim Weaver

            smarks Stuart Marks
            jweaver Jim Weaver (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: