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

[Circle] When the control is set dissabled there are no changes in opacity.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P5 P5
    • None
    • 8
    • javafx
    • jdk1.8.0_b64

      To reproduce:
      1. Click button "Set disabled"
      The color of the circle will remain. But it is expected to become 40% opacite.

      import javafx.application.Application;
      import javafx.event.ActionEvent;
      import javafx.event.EventHandler;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.layout.HBox;
      import javafx.scene.paint.Color;
      import javafx.scene.shape.Circle;
      import javafx.stage.Stage;

      public class BugCircleDisabled extends Application {

          @Override
          public void start(Stage stage) {

              HBox root = new HBox(20d);

              final Circle circle = new Circle(50, 50, 25, Color.BLUE);
              
              Button btnSetDisabled = new Button("Set disabled");
              btnSetDisabled.setOnAction(new EventHandler<ActionEvent>() {
                  @Override
                  public void handle(ActionEvent t) {
                      circle.setDisable(true);
                  }
              });

              Button btnGetValue = new Button("Get disabled");
              btnGetValue.setOnAction(new EventHandler<ActionEvent>() {
                  @Override
                  public void handle(ActionEvent t) {
                      System.out.println(circle.disableProperty().getValue());
                  }
              });
              
              root.getChildren().addAll(circle, btnSetDisabled, btnGetValue);
              
              Scene scene = new Scene(root, 300, 250);

              stage.setScene(scene);
              stage.setTitle(System.getProperty("java.runtime.version") + "; " + System.getProperty("javafx.runtime.version"));
              stage.show();
          }

          public static void main(String[] args) {
              launch(args);
          }

      }

            dgrieve David Grieve
            dzinkevi Dmitry Zinkevich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: