如何使用applet代码打开文档

时间:2014-02-11 14:13:37

标签: java applet

我有以下代码,但似乎出了点问题。我试图解决它,但我堆叠它。任何帮助将不胜感激...... thx

/* <applet code="showDemo" height=300 width=300> </applet> */
import java.awt.*;
import java.applet.*;
import java.net.*;
@SuppressWarnings("serial")
public class ShowDemo extends Applet
{
public void start() {
AppletContext ac = getAppletContext();
URL url = getCodeBase();
try{
ac.showDocument(new URL(url + "F:/Work_deepika/JavaVsAndroid.doc"));
}catch(MalformedURLException e){
showStatus("URL not Found ");
}
}

0 个答案:

没有答案