首页>代码>JAVA.2核心技术.第1卷:基础知识(原书第7版) 源代码>/JAVA.2核心技术.第1卷:基础知识(原书第7版) 源代码/v1ch10/AppletApplication/AppletFrame.java
/**
   @version 1.31 2004-05-07
   @author Cay Horstmann
*/

import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.io.*;
import java.net.*;
import java.util.*;
import javax.swing.*;

public class AppletFrame extends JFrame
   implements AppletStub, AppletContext
{  
   public AppletFrame(Applet anApplet)
   {  
      applet = anApplet;
      add(applet);
      applet.setStub(this);
   }

   public void setVisible(boolean b)
   {
      if (b) 
      {
         applet.init();
         super.setVisible(true);
         applet.start();
      }
      else 
      {
         applet.stop();
         super.setVisible(false);
         applet.destroy();
      }
   }
  
   // AppletStub methods
   public boolean isActive() { return true; }
   public URL getDocumentBase() { return null; }
   public URL getCodeBase() { return null; }
   public String getParameter(String name) { return ""; }
   public AppletContext getAppletContext() { return this; }
   public void appletResize(int width, int height) {}
   
   // AppletContext methods
   public AudioClip getAudioClip(URL url) { return null; }
   public Image getImage(URL url) { return null; }
   public Applet getApplet(String name) { return null; }
   public Enumeration getApplets() { return null; }
   public void showDocument(URL url) {}
   public void showDocument(URL url, String target) {}
   public void showStatus(String status) {}
   public void setStream(String key, InputStream stream) {}
   public InputStream getStream(String key) { return null; }
   public Iterator getStreamKeys() { return null; }

   private Applet applet;
}

最近下载更多
linmou  LV8 2023年3月19日
徐寿亮  LV1 2021年4月21日
xcj456  LV8 2020年9月12日
szy2503  LV2 2020年8月10日
moomin709  LV24 2020年2月19日
wsk588  LV26 2020年1月15日
ak130112  LV1 2019年12月31日
jizhaojian88  LV11 2019年8月20日
czh0510  LV12 2019年3月26日
罗颖钊  LV3 2018年12月6日
最近浏览更多
linmou  LV8 2023年3月19日
徐寿亮  LV1 2021年4月21日
高欢胜  LV1 2021年3月29日
2196316269  LV10 2021年2月24日
13043860zj  LV16 2020年9月24日
xcj456  LV8 2020年9月12日
szy2503  LV2 2020年8月10日
16692039904  LV2 2020年6月25日
fighter919  LV1 2020年5月6日
hb2008  LV3 2020年4月25日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友