user3414459
user3414459

Reputation:

Set Global CSS Style Sheet in JavaFX with fxml and SceneBuilder

How do I set a global css style sheet ? I'm using fxml and scene builder. I added it to resources directory in my project and

<BorderPane fx:id="mainBorder" onDragDetected="#minimize" prefHeight="400.0" prefWidth="700.0" style="-fx-background-color: white;" stylesheets="../../../../../../resources/css/JTheme.css" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.s.c.desktop.template.RootLayoutController">

But it doesn't work :(.

Upvotes: 0

Views: 1311

Answers (1)

ItachiUchiha
ItachiUchiha

Reputation: 36742

You are missing a @ in your url.

Try to replace your stylesheets with :

stylesheets="@../../../../../../resources/css/JTheme.css"

Upvotes: 1

Related Questions