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

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

    XMLWordPrintable

Details

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

    Description

      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.shape.Line;
      import javafx.stage.Stage;

      public class BugLine extends Application {

          @Override
          public void start(Stage stage) {

              HBox root = new HBox(20d);

              final Line line = new Line(10, 10, 60, 60);
              
              Button btnSetDisabled = new Button("Set disabled");
              btnSetDisabled.setOnAction(new EventHandler<ActionEvent>() {
                  @Override
                  public void handle(ActionEvent t) {
                      line.setDisable(true);
                  }
              });

              Button btnGetValue = new Button("Get disabled");
              btnGetValue.setOnAction(new EventHandler<ActionEvent>() {
                  @Override
                  public void handle(ActionEvent t) {
                      System.out.println(line.disableProperty().getValue());
                  }
              });
              
              root.getChildren().addAll(line, 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);
          }

      }

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:
                Imported: