使用 Java Applet 製作動態網頁

上一章 | 下一章 | 首頁 ]

Java 的特性

  1. 簡化的 C++ 語言
  2. 跨平台(write once, run anywhere)
  3. 可透過 Internet 將程式下載至 Local 端執行
  4. 使首頁設計活潑化
  5. 可開發專屬 Web 的 java applet 以及獨立程式





Java Applet 運作方式





Java Applet 語法

<APPLET Standard-Attributes>
<APPLET-Parameters>
  :
  :
alternate-content
</APPLET>

範例

<APPLET CODE="HelloWorld.class" WIDTH=100 HEIGHT=30>
<PARAM NAME=text VALUE="Hello World!">
Get a <B>Java-</B>powered browser!
</APPLET>





APPLET 屬性

必須屬性:

code

Java applet 的檔名(大小寫須完全一致)

width

Applet 的寬度 (單位為 pixels)

height

Applet 的高度 (單位為 pixels)


選擇屬性:

codebase  

Applet 所在的 URL

alt

替代文字

name

Applet 的名稱

align

Applet 的對齊方式

vspace

在 Applet 垂直上下的空間

hspace

在 Applet 左右的水平空間





運用 Java Applet 範例

上一章 | 下一章 | 首頁 ]