Redefinition of tooltip style using stylesheet works in Java Scene Builder.
Redefinition of tooltip style at execution in eclipse with the same stylesheet included in FXML file generated from scene builder with
<stylesheets>
<URL value="@../style/myCSS.css" />
</stylesheets>
does not work (any other property redefinition works).
Redefinition of tooltip style at execution in eclipse with same stylesheet using code instruction :
scene.getStylesheets().add(this.getClass().getResource("/style/myCSS.css").toExternalForm());
works properly.
Stylesheet used (myCSS.css):
.tooltip {
-fx-background-radius: 2 2 2 2;
-fx-background-color: linear-gradient(#FFFFFF, #DEDEDE);
}
.page-corner {
-fx-shape: " ";
}
AnchorPane {
-fx-background-color: firebrick;
}
FXML file used:
<AnchorPane id="AnchorPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="91.0" prefWidth="200.0" xmlns:fx="http://javafx.com/fxml">
<children>
<Button layoutX="72.0" layoutY="35.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="Button">
<tooltip>
<Tooltip text="Tootip Text" />
</tooltip>
</Button>
</children>
<stylesheets>
<URL value="@../style/myCSS.css" />
</stylesheets>
</AnchorPane>
Redefinition of tooltip style at execution in eclipse with the same stylesheet included in FXML file generated from scene builder with
<stylesheets>
<URL value="@../style/myCSS.css" />
</stylesheets>
does not work (any other property redefinition works).
Redefinition of tooltip style at execution in eclipse with same stylesheet using code instruction :
scene.getStylesheets().add(this.getClass().getResource("/style/myCSS.css").toExternalForm());
works properly.
Stylesheet used (myCSS.css):
.tooltip {
-fx-background-radius: 2 2 2 2;
-fx-background-color: linear-gradient(#FFFFFF, #DEDEDE);
}
.page-corner {
-fx-shape: " ";
}
AnchorPane {
-fx-background-color: firebrick;
}
FXML file used:
<AnchorPane id="AnchorPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="91.0" prefWidth="200.0" xmlns:fx="http://javafx.com/fxml">
<children>
<Button layoutX="72.0" layoutY="35.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="Button">
<tooltip>
<Tooltip text="Tootip Text" />
</tooltip>
</Button>
</children>
<stylesheets>
<URL value="@../style/myCSS.css" />
</stylesheets>
</AnchorPane>