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

Vararg constructor not found

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 8
    • None
    • core-libs
    • None
    • b89
    • Verified

    Description

      Trying to construct a JavaFX object:


          var colors = new Rectangle(WIDTH, HEIGHT,
                  new LinearGradient(0, 1, 1, 0,true, CycleMethod.NO_CYCLE,
                                            new Stop(0, Color.web("#f8bd55")),
                                            new Stop(0.14, Color.web("#c0fe56")),
                                            new Stop(0.28, Color.web("#5dfbc1")),
                                            new Stop(0.43, Color.web("#64c2f8")),
                                            new Stop(0.57, Color.web("#be4af7")),
                                            new Stop(0.71, Color.web("#ed5fc2")),
                                            new Stop(0.85, Color.web("#ef504c")),
                                            new Stop(1, Color.web("#f2660f"))));

      Yields;


      Caused by: colourfulcircles.js:51 TypeError: Can not construct javafx.scene.paint.LinearGradient with the passed arguments; they do not match any of its constructor signatures.

      LinearGradient(double startX, double startY, double endX, double endY, boolean proportional, CycleMethod cycleMethod, java.util.List<Stop> stops)

      LinearGradient(double startX, double startY, double endX, double endY, boolean proportional, CycleMethod cycleMethod, Stop... stops)

      It is quite obvious it should match the vararg signature.

      Attachments

        Activity

          People

            attila Attila Szegedi
            attila Attila Szegedi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: