Correct way to set the path of a BackgroundImage in JavaFX CSS -
i have anchorpane , want style giving backgroundimage have in package :
here's css tried:
#body { -fx-background-image:url("/images/flowerspattern_beige_background.jpg"); }
using javascript set anchorpane's css id body
; didn't work. tried check other questions asked, didn't help. please can clarify how, exactly, should done?
if css
file loaded normally, replacing:
"/images/flowerspattern_beige_background.jpg"
with
"../images/flowerspattern_beige_background.jpg"
should work.
the path relative css
file's directory, ..
accesses parent directory (src
); /images
refers images directory; /flowerspattern_beige_background.jpg
accesses image.
Comments
Post a Comment