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

[CSS] Cannot set -fx-fill to a url, causes ClassCastException

XMLWordPrintable

      The following should work but throws a ClassCastException because CSS is trying to set the fill to a String. This did work at some point in time. Apparently, there is no unit test for it.
          
          @Override public void start(Stage stage) throws Exception {

              Rectangle rect = new Rectangle(50,50);
              rect.setStyle("-fx-fill: url('https://duke.kenai.com/wave/Wave.png');");
              VBox vbox = new VBox();
              vbox.getChildren().add(rect);
              stage.setScene(new Scene(vbox));
              stage.show();
          }

      I ran this against both 7u60 and 8u20. Both throw the CCE.

            dgrieve David Grieve
            dgrieve David Grieve
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: