[英]Embed applet into html page issue
我很難嵌入一個簡單的小程序。 我認為類文件名的相對/絕對路徑設置有問題。 我嘗試了許多不同的方法來完成此操作,但沒有一個成功。 除了一個例外。 如果我將indexApplet.html文件放在bin文件夾中,則它可以工作。 但我想將indexApplet.html保留在其中。 我將非常感謝您對此事的任何幫助。
這是我的html代碼和文件夾結構:
[code]
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Java Game</title>
</head>
<body>
<applet code="test/bin/first/hello.class" width="800" height="600" alt="Java Game" title="Go and Play"></applet>
</body>
</html>
[/code]
該類文件位於:C:\\ Users \\ Valentin \\ workspace \\ test \\ bin \\ first
我想將indexApplet.html文件放在測試文件夾之外。
假設您正在從C:\\Users\\Valentin\\workspace
查看applet,並且在第first
包中聲明了hello
類,那么您需要添加codebase
屬性:
<applet code="first.hello.class" width="800" height="600" codebase="test/bin">
閱讀: 使用小程序,對象和嵌入標簽
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.