資源簡介

代碼片段和文件信息
import?java.applet.applet;
import?java.applet.appletContext;
import?java.applet.appletStub;
import?java.applet.AudioClip;
import?java.awt.frame;
import?java.awt.Image;
import?java.awt.Toolkit;
import?java.awt.event.WindowListener;
import?java.awt.event.WindowEvent;
import?java.io.File;
import?java.io.IOException;
import?java.io.InputStream;
import?java.net.MalformedURLException;
import?java.net.URL;
import?java.util.Enumeration;
import?java.util.Hashtable;
import?java.util.Iterator;
/**
?*?A?frame?for?running?an?applet?so?the?applet?can?run?as?an?application.
?*/
public?class?appletframe?extends?frame?implements?appletStub?appletContext?WindowListener?
{
????Gameapplet?applet;
????Hashtable?props?=?new?Hashtable?();
??????
????/**
?????*?Construct?a?frame?of?the?given?size?to?run?the?given?applet
?????*
?????*?@param?name?the?frames?title
?????*?@param?applet?the?applet?to?run
?????*?@param?width?width?of?the?game?frame
?????*?@param?height?height?of?the?game?frame
?????*/
????public?appletframe?(String?name?Gameapplet?applet?int?width?int?height)?{
????????
????????super?(name);
????????this.applet?=?applet;
????????applet.setStub?(this);
????????applet.setAsApplication();
????????
????????//?Get?insets
????????show?();
????????width?+=?this.getInsets().left?+?this.getInsets().right;
????????height?+=?this.getInsets().top?+?this.getInsets().bottom;
????????hide?();
????????
????????setSize?(width?height);
????????this.add?(“Center“?applet);
????????show?();
????????//注冊窗口事件
????????addWindowListener?(this);
????????applet.init?();
????????applet.start?();
????}
????//?appletStub?API
????//當applet要重新調整大小時調用
????public?void?appletResize?(int?width?int?height)?{
????????setSize?(width?height);
????}
????//獲取applet上下文的處理程序。
????public?appletContext?getappletContext?()?{
????????return?this;
????}
????//獲取基?URL
????public?URL?getCodebase?()?{
????????URL?u?=?null;
????????try?{?
????????????u?=?new?File?(System.getProperty?(“user.dir“)).toURL?();?
????????}
????????catch?(MalformedURLException?me)?{}
????????
????????return?u;
??}
????//獲取嵌入?applet?的文檔的?URL
????public?URL?getDocumentbase?()?{
????????URL?u?=?null;
????????try?{?
????????????u?=?new?File?(System.getProperty?(“user.dir“)).toURL?();?
????????}
????????catch?(MalformedURLException?me)?{}
????????
????????return?u;
??}
????//返回?HTML?標記中命名參數的值
????public?String?getParameter?(String?name)?{
????????return?(String)?props.get?(name);
????}
?????//設置?HTML?標記中命名參數的值
????public?void?setParameter?(String?name?String?value)?{
????????props.put?(name?value);
????}
????//確定?applet?是否處于激活狀態
????public?boolean?isActive?()?{
????????return?true;
????}
????//?appletContext?API
????//使用給定的名稱找到并返回此?applet?上下文所代表的文檔中的?applet。
????public?applet?getapplet?(String?name)?{
????????return?applet;
????}
????//找到此?applet?上下文所代表的文檔中的所有?applet。
????public?Enumeration?getapplets?()
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????16551??2006-05-11?17:19??FrozenBubble\applause.au
?????文件???????4498??2006-10-01?20:36??FrozenBubble\ap
?????文件?????109789??2006-05-11?17:20??FrozenBubble\background.jpg
?????文件????????970??2006-05-11?17:20??FrozenBubble\bubble-1.gif
?????文件???????1011??2006-05-11?17:20??FrozenBubble\bubble-2.gif
?????文件???????1022??2006-05-11?17:20??FrozenBubble\bubble-3.gif
?????文件???????1021??2006-05-11?17:20??FrozenBubble\bubble-4.gif
?????文件????????985??2006-05-11?17:20??FrozenBubble\bubble-5.gif
?????文件???????1017??2006-05-11?17:20??FrozenBubble\bubble-6.gif
?????文件???????1016??2006-05-11?17:20??FrozenBubble\bubble-7.gif
?????文件???????1014??2006-05-11?17:20??FrozenBubble\bubble-8.gif
?????文件???????1644??2006-05-11?17:20??FrozenBubble\bubble-bl
?????文件???????1776??2006-05-11?17:20??FrozenBubble\bubble-colourblind-1.gif
?????文件???????1786??2006-05-11?17:20??FrozenBubble\bubble-colourblind-2.gif
?????文件???????1762??2006-05-11?17:20??FrozenBubble\bubble-colourblind-3.gif
?????文件???????1787??2006-05-11?17:20??FrozenBubble\bubble-colourblind-4.gif
?????文件???????1765??2006-05-11?17:20??FrozenBubble\bubble-colourblind-5.gif
?????文件???????1776??2006-05-11?17:20??FrozenBubble\bubble-colourblind-6.gif
?????文件???????1797??2006-05-11?17:20??FrozenBubble\bubble-colourblind-7.gif
?????文件???????1784??2006-05-11?17:20??FrozenBubble\bubble-colourblind-8.gif
?????文件???????7341??2006-05-11?17:20??FrozenBubble\bubbleFont.gif
?????文件???????1132??2006-09-25?10:15??FrozenBubble\BubbleFont.java
?????文件???????1384??2006-10-05?12:02??FrozenBubble\BubbleManager.java
?????文件??????10074??2006-10-20?15:10??FrozenBubble\BubbleSprite.java
?????文件????????882??2006-05-11?17:20??FrozenBubble\close_eyes.gif
?????文件???????6835??2006-05-11?17:20??FrozenBubble\compressor.gif
?????文件????????887??2006-05-11?17:19??FrozenBubble\Compressor.java
?????文件???????1040??2006-05-11?17:20??FrozenBubble\compressorBody.gif
?????文件??????18321??2006-05-11?17:19??FrozenBubble\COPYING.txt
?????文件??????17333??2006-05-11?17:19??FrozenBubble\destroy_group.au
............此處省略93個文件信息
評論
共有 條評論