I'm having a frustrating time trying to set my background image in my css file using scenebuilder and JavaFx. I put the file in my projects folder (my view package ) and I even set my id and Style in the right hand side of my scenebuuilder window. I still cant get the image to appear. I can get a color to appear and everything else but I cant get that image.my id
Is set as AnchorPane so I used this in my style sheet:
Then I did this in my Main Class and method:
and after all this I get No image. I just wan't to know what I'm doing wrong for something soooo simple?
I've added several screen shots just to give you an idea...
When you specify a url within a css file then the url will be relative to where the referencing css file is. In your case, from your screen captures, your table.JPG file is in the same directory as your css file in which case try this:
Also watch out for case sensitivity, on some platforms it matters, eg "jpg" versus "JPG".
We don't have time to be charming! Quick, read this tiny ad: