Correct way to set the path of a BackgroundImage in JavaFX CSS -


i have anchorpane , want style giving backgroundimage have in package : file structure screenshot

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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -