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

NullPointerException when trying to render Box with Opacity

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 8
    • javafx
    • Windows 7 64Bit; Java8 Snapshot b87

      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();
          }

      }

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

              Created:
              Updated:
              Resolved:
              Imported: