I am trying to display a swf file within a window, very simple like in the tutorial 5.15.1 Embedded Objects
Just does not work for me, could someone help out here please ?
public class FusionchartapplicationApplication extends Application
{
@Override
public void init()
{
System.out.println("inint ");
this.setTheme("fusionchartapplicationtheme");
Window w = new Window();
setMainWindow(w);
w.addComponent(getFlash());
}
public Component getFlash()
{
// Create a Shockware Flash resource
final ClassResource flashResource = new ClassResource(
"swf/opener.swf", getMainWindow().getApplication());
// Display the resource in a Embedded compoant
final Embedded embedded = new Embedded("Embedded 12345 Caption",
flashResource);
// This is the default type, but we set it anyway.
embedded.setType(Embedded.TYPE_OBJECT);
// This is recorgnized automatically, but set it anyway.
embedded.setMimeType("application/x-shockwave-flash");
return embedded;
}
}
Have you tried to set a width and height to your embedded component and see if it matters?
Or have you checked what ends up in the DOM e.g. using Firebug?
http://demo.vaadin.com/sampler#FlashEmbed is an example of how you can embed flash.
A ClassResource is loaded by the classloader from the classpath so for using that the file should be in the source/build folder in your project. The url is a generated url used internally by Vaadin to load the resource.
If your resource is in the theme folder you should use ThemeResource, that one will be directly loaded from the theme folder so the url will not be a generated one.