2012-10-17 31 views

回答

2

对于这一点,你必须使用流资源..只要勾选下面的示例代码..

最好的运气为你的签证过程:)

Window window = new Window(); 

    setMainWindow(window); 

    Label label = new Label("Embed tag"); 

    label.setDebugId("lblMsg"); 


    window.addComponent(label); 

    StreamSource s = new StreamResource.StreamSource() { 

    @Override 
    public InputStream getStream() { 
    File f = new File("C:/test/test.swf"); 
    FileInputStream fis=null; 
    try { 
    fis = new FileInputStream(f); 
    } catch (FileNotFoundException e) { 
    // TODO Auto-generated catch block 
    e.printStackTrace(); 
    } 
    return fis; 
    } 
    }; 

    StreamResource r = new StreamResource(s,"application/x-shockwave-      flash",getMainWindow().getApplication()); 
    Embedded e = new Embedded(); 
    e.setType(Embedded.TYPE_OBJECT); 
    e.setMimeType("application/x-shockwave-flash"); 
    e.setSource(r); 
    e.setWidth("400px"); 
    e.setHeight("400px"); 

    window.addComponent(e); 
+0

感谢帮助 – nirmal90

相关问题