⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 14.htm

📁 javaapplet的几个比较好的例子 适合初学者 javaapplet主要用于网页,实现一些插件的功能
💻 HTM
字号:
<html><!-- #BeginTemplate "/Templates/empolder_doc.dwt" -->
<head>
<!-- #BeginEditable "doctitle" --> 
<title>|&gt;&lt;| 太平洋电脑信息网 -&gt; 网络学院 -&gt; 开发教室</title>
<!-- #EndEditable --> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
-->
</style>
<link rel="stylesheet" href="/pcedu/style/text.css"></head>

<body bgcolor="#FFFFFF" topmargin=0 leftmargin=0 marginheight="0">
<script language="JavaScript" src="/pcedu/script/top.js">
</script>
<table width=760 border=0 cellspacing=0 cellpadding=0 align=center>
  <tr> 
    <td width=194 height="56"><a href=http://www.pconline.com.cn><img src=http://www.pconline.com.cn/images/pconlinelogo.gif width=162 height=35 vspace=10 border=0></a></td>
    <td width=406 height="56">
      <script language="JavaScript" src="/pcedu/script/empolder_ad.js">
</script>
    </td>
    <td width=158 align=right height="56">
      <script language="JavaScript" src="/pcedu/script/empolder_ad1.js">
</script>
    </td>
    <td align=right width=2 height="56">&nbsp;</td>
  </tr>
</table>
<table border=0 cellpadding=0 cellspacing=0 width=760 align="center">
  <tbody> 
  <tr valign=bottom> 
    <td rowspan=2 width=172><img height=32 src="/pcedu/images/pcedu_lo.gif" 
      width=172 border="0"></td>
    <td height=30 rowspan=2> 
      <table cellpadding=0 cellspacing=0 width="588" bgcolor="#FFA000" background="/pcedu/images/e_menu5.gif" border="0">
        <tbody> 
        <tr valign="bottom"> 
          <td height="17"> 
            <script language="JavaScript" src="/pcedu/script/title_empolder.js">
</script>
          </td>
        </tr>
        </tbody> 
      </table>
    </td>
  </tr>
  <tr></tr>
  <tr bgcolor="#303880"> 
    <td colspan=2 height=1 valign=bottom><img height=1 
      src="/pcedu/images/blank.gif" width=1></td>
  </tr>
  <tr> 
    <td colspan=2 height=5 valign=bottom><img height=5 
      src="/pcedu/images/blank.gif" width=1></td>
  </tr>
  </tbody> 
</table>
<table width="760" cellspacing="0" cellpadding="0" align="center" height="37">
  <tr> 
    <td width="170" valign="top"> 
      <table border="0" width="170" height="100%"
    cellspacing="1" bgcolor="#000000">
        <tr bgcolor="#F8F8D2"> 
          <td width="100%" valign="top"><!-- #BeginEditable "left" --> 
            <div align="center"> 
              <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000" align="center">
                <tr bgcolor="#E17329"> 
                  <td height="20" align="center"><font color="#FFFFFF">==<b>开发教室==</b></font></td>
                </tr>
              </table>
              <br>
            </div>
            <!-- #EndEditable -->
            <script language="JavaScript" src="/pcedu/script/left_empolder.js">
</script>
          </td>
        </tr>
      </table>
    </td>
    <td width="10"><img src="/pcedu/images/blank.gif" width="1" height="1"></td>
    <td width="580" valign="top" class="article"> 
      <p><img src="/pcedu/images/666666.gif" width="99%" height="1"></p>
      <!-- #BeginEditable "content" --> 
      <p align="center"><span class="title">Java Applet 入门</span></p>
      <p align="right"><a href="mailto:yy435@263.net">yy435</a></p>
      <p align="right">太平洋网络学院</p>
      <p align="center" class="green">第三天</p>
      <p align="left" class="green">4.标 签</p>
      <p><font size="3">标签,就是用户只能查看,不能修改的文本显示区域,它能起到信息说明的作用,每个标签用一个Label类的对象表示。请看例子:</font></p>
      <table width="158" border="2" cellspacing="2" cellpadding="2" bordercolor="#FF6666">
        <tr> 
          <td> 
            <p>例子:</p>
            <p><applet code="Applet2.class" width="150" height="60">
              </applet></p>
          </td>
        </tr>
      </table>
      <p><font size="3">上面的例子是怎样用JAVA实现的呢?<br>
        它的语法如下:</font></p>
      <p><font color="#FF9966">……//与前面的例子一样!</font><br>
        1. Label prompt1=new Label(&quot;这是标签 1 !&quot;);<br>
        2. Label prompt2=new Label (&quot;这是标签 2 !&quot;);<br>
        3. add(prompt1);<br>
        4. add(prompt2);<br>
        <font color="#FF9933">……//与前面的例子一样!</font> </p>
      <pre>
分析:
第1行:调用函数 Label 建立第 1 个标签 prompt1; 
第2行:调用函数 Label 建立第 2 个标签 prompt2; 

第3行:将标签 1 加入到容器中去,以使起能够在屏幕上显示出来。
第4行:同样,将标签2加入到容器中去,以使起能够在屏幕上显示出来。

    标签不能接受用户的输入,所以不能引发事件,不是事件源。如果
希望修改标签上显示的文本,可以使用Label对象的方法getText(新字符
串),同样对于一个未知的标签,可以通过调用Label对象getText()
方法来获得它的文本内容。 </pre>
      <div align="center"> <a href="13.htm">[上一页]</a> <a href="15.htm">[下一页]</a></div>
      <!-- #EndEditable --> 
      <table width="100%" border="0">
          <tr class="sfont"> 
            <td>
              <div align="center"><a href="javascript:history.go(-1)">[返回]</a>
              </div>
            </td>
          </tr>
        </table>
      </td>
  </tr>
</table>
<hr noshade size="2" width="760">
<div align="center"> 
  <p align="center"><font color="#000000"> 
    <script language="JavaScript" src="/pcedu/script/title_edu.js">
</script>
    </font> <br>
    <br>
    版权所有&copy;2000 太平洋电脑网<br>
    <font face="Arial, Helvetica, sans-serif"> 
    <script>
document.write("<a href=http://best.netease.com/cgi-bin/view/viewbasic.cgi?exp target=_blank><img src=http://best.netease.com/cgi-bin/log.cgi?user=exp&refer="+escape(document.referrer)+"&cur="+escape(document.URL)+" border=0 alt='网易中文排行榜' width=1 height=1></a>");
</script>
    <a href=mailto:webmaster@pconline.com.cn> </a></font><font face="Arial, Helvetica, sans-serif"><a href=mailto:webmaster@pconline.com.cn>webmaster@pconline.com.cn</a></font><font face="Arial, Helvetica, sans-serif"><a href=mailto:webmaster@pconline.com.cn> 
    <script language="">document.write("<a href=http://best.netease.com/cgi-bin/view/viewbasic.cgi?pconline1 target=_blank><img src=http://best.netease.com/cgi-bin/log.cgi?user=pconline1&refer="+escape(document.referrer)+"&cur="+escape(document.URL)+" border=0 width=1 height=1 ></a>");</script>
    </a> 
    <script language="">
document.write("<a href=http://count.pconline.com.cn/admin/index.php target=_blank><img src=http://count.pconline.com.cn/count.php?user=pcedu&refer="+escape(document.referrer)+" border=0 width=0 height=0 alt='' ></a>");
</script>
    </font> </p>
    </div>
 
</body>
<!-- #EndTemplate --></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -