2012-10-17 33 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