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

JavaFX Tutorial Chapter 1 shapes.fx got compilation errors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • fx1.1
    • fx1.1
    • docs
    • None
    • 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.

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

              Created:
              Updated:
              Resolved:
              Imported: