I am having trouble with this sample not styling the background borderpane green. The css has NO effect at all no matter how much I tweak it. My code:
StackoverflowQuestion.scala
import scalafx.application.JFXApp
import scalafx.application.JFXApp.PrimaryStage
import scalafx.scene.Scene
import scalafx.scene.control.Button
import scalafx.scene.layout.BorderPane
object StackoverflowQuestion extends JFXApp {
stage = new PrimaryStage {
title = "Stackoverflow Sample"
scene = new Scene {
stylesheets add getClass.getResource("app.css").toExternalForm
content = new BorderPane {
id = "background"
center = new Button {
text = "Button"
}
}
}
}
}
app.css
#background {
-fx-background-color: green;
}
I did see this related post but it has no answer JavaFx Css not working with eclipse. I know that the css is being read because it prints a error if I remove a brace from the css