0
我用Google搜索和研究我仍然不明白的地方,我錯了。
我的程序由三個類組成:myFrame
,myRightPanel
和calculationEngine
。 myFrame
是延伸JApplet
類的,我這樣做:
public class myFrame extends JApplet implements ActionListener {
//bunch of things here
}
myRightPanel類和calculationEngine類的實例化和myFrame使用。整個代碼在eclipse中的applet查看器中工作正常。我面臨的麻煩是將它嵌入到html中。我這樣做,它不起作用。
<!DOCTYPE html>
<html>
<body>
<marquee>
<h1> Ghun Chaatlo </h1></marquee>
<applet code="myFrame.class" height="800" width= "1200">
</applet>
</body>
</html>
所有文件:.html和.class文件位於同一目錄中。但是,當我運行的HTML,它不顯示該小程序。 IDK爲什麼?請幫忙。
這是你在找什麼:http://stackoverflow.com/questions/4272666/embedding-java-applet-into-html-文件 – Jef
這篇文章可能會幫助你http://stackoverflow.com/questions/7999343/applet-code-tags-and-class-files –
你是通過網絡服務器加載html頁面嗎?或直接打開文件?直接加載時,瀏覽器的安全管理器不允許加載小程序。 –