embedded.setDescription("Click on the grid cells to switch them.");
addComponent(embedded);
// Attach it to a resource.
final MyImageSource imageSource = new MyImageSource();
final StreamResource imageResource = new StreamResource(imageSource,
"testimage.png");
imageResource.setCacheTime(0);
embedded.setSource(imageResource);
// The button requests repainting the embedded.
Button button = new Button("refr");
button.addListener(new Button.ClickListener() {