how to set background image?

hi all,
i’m new to vaadin. i’m stunk when i try to set the background image for a label/window with PURE JAVA code.
after a quick search, it seems it cannot be complished with PURE JAVA. can someone here confirm that?

regards,
Andrew

Correct, you need CSS to change any background image in Vaadin.

For what it’s worth, I highly recommend learning the basics (at least) of CSS. I used Vaadin for a couple years before learning anything about CSS, and once I did things became a
lot
clearer to me. If you’re familiar at all with (x)html, then CSS won’t take you long to learn. Plus, it’s one way to hack at your Vaadin app without redeployment or restarting – you can edit css files on the server and reload (oddly fun to me). You’ll think about the way you write HTML or web apps differently once you have the CSS tool available.

In a Vaadin app, with a styles.css file in place, you never need to waste time fidding with spacing around components in the Java write/compile/deploy cycle. Just add a style name and test it in the server, then when you’re happy add your changes back to the css file in your code.

(I’m hesitant to make recommendations for sources on this kind of thing, but I read the CSS chapters of the “Head First” HTML book and it worked well for me.)

I have a simple example online. Look for the keyword “fullpage” in the css file and Java code of
this app
. Maybe that will help, or at least give you an example so that you can experiment with the CSS file to see what’s going on.

Cheers,
Bobby