wicket.markup.html.tree.Tree, and you want to override the node images. You need to provide a wicket.markup.html.image.Image, as follows:public class NavTree extends Tree
{
@Override
protected Image getNodeImage(DefaultMutableTreeNode node)
{
...
}
}
To colocate my images for such purposes, I created a package, say com.my.images, and in that directory, I created an empty class called ImageAnchor.java. Then to create my image I can call:
new Image(Tree.NODE_IMAGE_NAME,
new ResourceReference(com.my.images.ImageAnchor.class, "penguin.gif"));
But what if I also want to refer to my images from html or css? Fortunately, there is a way to do this. For example, in CSS:
background-image:url(/app/resources/com.my.images.ImageAnchor/penguin.gif);
4 comments:
so, you have all your imaegs in src/com/my/images? Or you create web-inf.images.ImageAnchor ?
Yes, all my images and ImageAnchor.java are in src/com/my/images.
Post a Comment