📄 11_1.htm
字号:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Weng Kai">
<meta name="GENERATOR" content="Mozilla/4.5 [en] (Win95; I) [Netscape]">
<title>The basic applet</title>
</head>
<body>
<h2>
11.1 The basic applet</h2>
<hr WIDTH="100%">
<br>You inherit from class <b>Applet</b> and override the application methods.
<p>paint() is called automatically when the applet decides that it needs
to update itself. When paint() is called, a handle to a Graphics
object that represents the surface on which you can paint is passed into
the method.
<p>Case Study: <a href="case/Applet/Applet1.java">Applet1.java</a><applet code=Applet1 width=100 height=20 codebase=case/Applet></applet>
<p>To run an applet, you must place it into a Web page and view the page
inside a Java-enabled Web browser.
<br>
<hr WIDTH="100%">
<br>An applet has its life cycle like a <i>thread</i> does.
<p><a href="case/Applet/Applet3.java">Applet3.java</a><applet code=Applet3 width=200 height=20 codebase=case/Applet></applet>
<br>
<center><table BORDER WIDTH="100%" >
<tr>
<td>init()</td>
<td>Called when the applet is first created to perform first-time initialization
of applet</td>
</tr>
<tr>
<td>start()</td>
<td>Called every time the applet moves into sight on the Web browser to
allow the applet to start</td>
</tr>
<tr>
<td>stop()</td>
<td>Called every time the applet moves out of sight on the Web browser
to allow the applet to shut off expensive operations. Alse called
before destory()</td>
</tr>
<tr>
<td>destory()</td>
<td>Called when the applet is being unloaded from the page to perform final
release of resources when the applet is no longer used</td>
</tr>
</table></center>
<p>
<hr WIDTH="100%">
<div align=right><a href="11_2.htm">Next Page</a></div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -