I am compiling colors.fx in JavaFX Tutorial lesson 1 from
http://inkspb.russia.sun.com/FXDocs/Concepts/Franca/ui/overview/colors.fx
which is on the page: http://inkspb.russia.sun.com/FXDocs/Concepts/Franca/ui/overview/index.html,
by using javafx1.1-b03, got the following compilation errors:
C:\>javafx-sdk1.1\bin\javafxc colors.fx
Color.fx:3: Color is already defined in this compilation unit
import javafx.scene.paint.Color;
^
1 error
The code I copied from the tutorial as following:
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
def size = 19; // the color box size
def space = 3; // the space between boxes
def width = 10;
def height = 14;
def colors = [
"aliceblue", "antiquewhite", "aqua", "aquamarine",
"azure", "beige", "bisque", "black",
"blanchedalmond", "blue", "blueviolet", "brown",
"burlywood", "cadetblue", "chartreuse", "chocolate",
"coral", "cornflowerblue", "cornsilk", "crimson",
"cyan", "darkblue", "darkcyan", "darkgoldenrod",
"darkgreen", "darkgrey", "darkkhaki", "darkmagenta",
"darkolivegreen", "darkorange", "darkorchid", "darkred",
"darksalmon", "darkseagreen", "darkslateblue", "darkslategrey",
"darkturquoise", "darkviolet", "deeppink", "deepskyblue",
"dimgrey", "dodgerblue", "firebrick", "floralwhite",
"forestgreen", "fuchsia", "gainsboro", "ghostwhite",
"gold", "goldenrod", "green", "greenyellow",
"grey", "honeydew", "hotpink", "indianred",
"indigo", "ivory", "khaki", "lavender",
"lavenderblush", "lawngreen", "lemonchiffon", "lightblue",
"lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgreen",
"lightgrey", "lightpink", "lightsalmon", "lightseagreen",
"lightskyblue", "lightslategrey", "lightsteelblue", "lightyellow",
"lime", "limegreen", "linen", "magenta",
"maroon", "mediumaquamarine", "mediumblue", "mediumorchid",
"mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen",
"mediumturquoise", "mediumvioletred", "midnightblue", "mintcream",
"mistyrose", "moccasin", "navajowhite", "navy",
"oldlace", "olive", "olivedrab", "orange",
"orangered", "orchid", "palegoldenrod", "palegreen",
"paleturquoise", "palevioletred", "papayawhip", "peachpuff",
"peru", "pink", "plum", "powderblue",
"purple", "red", "rosybrown", "royalblue",
"saddlebrown", "salmon", "sandybrown", "seagreen",
"seashell", "sienna", "silver", "skyblue",
"slateblue", "slategrey", "snow", "springgreen",
"steelblue", "tan", "teal", "thistle",
"tomato", "turquoise", "violet", "wheat",
"white", "whitesmoke", "yellow", "yellowgreen"
];
var color = "white";
Stage {
title: "Colors";
scene: Scene {
fill: bind Color.web(color);
width: space + (space + size) * width
height: space + (space + size) * height
content:
for (currentColor in colors)
Rectangle {
def j: Integer = indexof currentColor / width;
def i: Integer = indexof currentColor - j * width;
fill: Color.web(currentColor)
x: space + (space + size) * i
y: space + (space + size) * j
width: size
height: size
onMouseClicked: function(event) {
color = currentColor
}//OnMouseClicked
}//Rectangle
}//Scene
}//Stage
http://inkspb.russia.sun.com/FXDocs/Concepts/Franca/ui/overview/colors.fx
which is on the page: http://inkspb.russia.sun.com/FXDocs/Concepts/Franca/ui/overview/index.html,
by using javafx1.1-b03, got the following compilation errors:
C:\>javafx-sdk1.1\bin\javafxc colors.fx
Color.fx:3: Color is already defined in this compilation unit
import javafx.scene.paint.Color;
^
1 error
The code I copied from the tutorial as following:
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
def size = 19; // the color box size
def space = 3; // the space between boxes
def width = 10;
def height = 14;
def colors = [
"aliceblue", "antiquewhite", "aqua", "aquamarine",
"azure", "beige", "bisque", "black",
"blanchedalmond", "blue", "blueviolet", "brown",
"burlywood", "cadetblue", "chartreuse", "chocolate",
"coral", "cornflowerblue", "cornsilk", "crimson",
"cyan", "darkblue", "darkcyan", "darkgoldenrod",
"darkgreen", "darkgrey", "darkkhaki", "darkmagenta",
"darkolivegreen", "darkorange", "darkorchid", "darkred",
"darksalmon", "darkseagreen", "darkslateblue", "darkslategrey",
"darkturquoise", "darkviolet", "deeppink", "deepskyblue",
"dimgrey", "dodgerblue", "firebrick", "floralwhite",
"forestgreen", "fuchsia", "gainsboro", "ghostwhite",
"gold", "goldenrod", "green", "greenyellow",
"grey", "honeydew", "hotpink", "indianred",
"indigo", "ivory", "khaki", "lavender",
"lavenderblush", "lawngreen", "lemonchiffon", "lightblue",
"lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgreen",
"lightgrey", "lightpink", "lightsalmon", "lightseagreen",
"lightskyblue", "lightslategrey", "lightsteelblue", "lightyellow",
"lime", "limegreen", "linen", "magenta",
"maroon", "mediumaquamarine", "mediumblue", "mediumorchid",
"mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen",
"mediumturquoise", "mediumvioletred", "midnightblue", "mintcream",
"mistyrose", "moccasin", "navajowhite", "navy",
"oldlace", "olive", "olivedrab", "orange",
"orangered", "orchid", "palegoldenrod", "palegreen",
"paleturquoise", "palevioletred", "papayawhip", "peachpuff",
"peru", "pink", "plum", "powderblue",
"purple", "red", "rosybrown", "royalblue",
"saddlebrown", "salmon", "sandybrown", "seagreen",
"seashell", "sienna", "silver", "skyblue",
"slateblue", "slategrey", "snow", "springgreen",
"steelblue", "tan", "teal", "thistle",
"tomato", "turquoise", "violet", "wheat",
"white", "whitesmoke", "yellow", "yellowgreen"
];
var color = "white";
Stage {
title: "Colors";
scene: Scene {
fill: bind Color.web(color);
width: space + (space + size) * width
height: space + (space + size) * height
content:
for (currentColor in colors)
Rectangle {
def j: Integer = indexof currentColor / width;
def i: Integer = indexof currentColor - j * width;
fill: Color.web(currentColor)
x: space + (space + size) * i
y: space + (space + size) * j
width: size
height: size
onMouseClicked: function(event) {
color = currentColor
}//OnMouseClicked
}//Rectangle
}//Scene
}//Stage