• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JavaFx 8 and scenebuilder Help - CSS error parsing in-line style: -fx-background-image

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:



FXML



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...

projectsScreenShot.png
[Thumbnail for projectsScreenShot.png]
Project tree with css and image location inside packages
sceenBuilderscreenshot.png
[Thumbnail for sceenBuilderscreenshot.png]
scenebuuilder with css added in the properties window on the right
cssscreenshot.png
[Thumbnail for cssscreenshot.png]
my css code
 
Ranch Hand
Posts: 165
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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".
 
No one can make you feel inferior without your consent - Eleanor Roosevelt. tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic