I'm new to JavaFX and just started my first FX program. I created an FX project in NetBeans 7.3 and the project runs properly. All of the samples in the JavaFX samples download run as well. But when I try to do something as simple as setting the background color on my first scene to black, I can't get it to work. I find examples and documentation that tell me that what I am doing should work but it does not.
Scene scene = new Scene(root, 300, 250, Color.BLACK);
scene.setFill(Color.BLACK);
primaryStage.initStyle(StageStyle.UNDECORATED);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
The two bold lines are marked as errors. Unfortunately, I can't find a way to copy the error popup text in the IDE so I'll summarize. Both lines are giving errors that say that I gave a Color but a Paint was expected.
Is there something I am missing? Can it be this hard to set a background color in JavaFX?
Thanks.