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

NullPointerException when trying to render Box with Opacity

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 8
    • Fix Version/s: None
    • Component/s: javafx
    • Labels:
    • Environment:

      Windows 7 64Bit; Java8 Snapshot b87

      Description

      Crashes when trying to render a Box set to a PhongMaterial, with a Opacity in the Color Value.
      Execute the examplecode , and set the color in the ColorPicker to a opacety value !=1.

      Code:

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.ColorPicker;
      import javafx.scene.layout.StackPane;
      import javafx.scene.paint.PhongMaterial;
      import javafx.scene.shape.Box;
      import javafx.scene.shape.CullFace;
      import javafx.scene.shape.DrawMode;
      import javafx.stage.Stage;

      public class JavaFXApplication30 extends Application {

          @Override
          public void start(Stage primaryStage) {
              StackPane root = new StackPane();
              Box bounds = new javafx.scene.shape.Box(10 ,10,10);
              PhongMaterial material = new PhongMaterial();
              ColorPicker tmp = new ColorPicker();
              root.getChildren().add(tmp);
              material.diffuseColorProperty().bind(tmp.valueProperty());
              bounds.setMaterial(material);
              bounds.setDrawMode(DrawMode.FILL);
              bounds.setCullFace(CullFace.BACK);

              root.getChildren().add(bounds);

              Scene scene = new Scene(root, 300, 250);

              primaryStage.setTitle("Hello World!");
              primaryStage.setScene(scene);
              primaryStage.show();
          }

      }

        Attachments

          Activity

            People

            • Assignee:
              art Artem Ananiev
              Reporter:
              duke J. Duke (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: