JavaFX Tutorial Chapter 1 shapes.fx got compilation errors

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • fx1.1
    • Affects Version/s: fx1.1
    • Component/s: docs
    • None
    • Environment:

      WindowsXPpro SP3 with javafx-sdk1.1-b03

      I am running the shapes.fx code from JavaFX Tutorial lesson 1 by using javafx-sdk1.1-b03, got the compilation errors,
      the code I got from: http://inkspb.russia.sun.com/FXDocs/Concepts/Franca/ui/overview/shapes.fx

      C:\>javafx-sdk1.1\bin\javafxc shapes.fx
      .\Color.fx:3: Color is already defined in this compilation unit
      import javafx.scene.paint.Color;
      ^
      shapes.fx:10: cannot find symbol
      symbol : variable DARKSLATEGRAY
      location: class Color
      var stroke = Color.DARKSLATEGRAY;
                        ^
      shapes.fx:11: cannot find symbol
      symbol : variable CADETBLUE
      location: class Color
      var fill = Color.CADETBLUE;
                      ^
      shapes.fx:12: cannot find symbol
      symbol : variable GOLD
      location: class Color
      var alterfill = Color.GOLD;
                           ^
      shapes.fx:17: cannot find symbol
      symbol : variable LINEN
      location: class Color
                  fill: Color.LINEN;
                             ^
      5 errors

      Looks to me, the code needs to be added
       import javafx.scene.paint.Color;

      After I added it, it compiles fine and runs OK.

      So seems to me, the sample code should be standalone.

      Attached is the modified code which Color package added.

            Assignee:
            Alla Redko (Inactive)
            Reporter:
            Tao Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: