I am just learning scalaFX/javaFX after years with swing and months with scalaSwing. ScalaSwing had a few little issues that I felt weren't worth dealing with given the opportunity to update to something current. It Doesn't surprise me that I am having issues, but I am concerned.
Is this a problem with something I'm doing? I need black backgrounds and this seems to be failing and not telling me why.
I can sort of get this to work if I add the button first then a rectangle. I have tried wrapping the rectangle, but that is not the solution.
Thanks!
object Broken extends JFXApp {
stage = new PrimaryStage {
x = 0
y = 0
scene = new Scene {
stylesheets add getClass.getResource("Dark.css").toExternalForm
root = new FlowPane {
padding = Insets(10)
children = List(new Rectangle() {
x = 0
y = 0
width = 100
height = 150
arcHeight = 20
arcWidth = 20
fill = Color.Red
})
}
}
}
}
object Works extends JFXApp {
stage = new PrimaryStage {
x = 0
y = 0
scene = new Scene {
stylesheets add getClass.getResource("Dark.css").toExternalForm
root = new FlowPane {
padding = Insets(10)
children = List(new Button("Works"))
}
}
}
}
With this as Dark.css (file) in the same package
//Dark.css
.root{
-fx-font-size: 14pt;
-fx-font-family: "Courier New";
-fx-base: rgb(25,25,65);
-fx-background: rgb(0, 0, 0);
}