模块  java.desktop
软件包  java.applet

Interface AppletContext


  • @Deprecated(since="9")
    public interface AppletContext
    Deprecated.
    The Applet API is deprecated, no replacement.
    此接口对应于applet的环境:包含applet的文档和同一文档中的其他applet。

    applet可以使用此接口中的方法来获取有关其环境的信息。

    从以下版本开始:
    1.0
    • 方法详细信息

      • getAudioClip

        AudioClip getAudioClip​(URL url)
        Deprecated.
        创建音频剪辑。
        参数
        url - 提供音频剪辑位置的绝对URL。
        结果
        指定URL处的音频剪辑。
      • getImage

        Image getImage​(URL url)
        Deprecated.
        返回一个Image对象,然后可以在屏幕上绘制。 作为参数传递的url参数必须指定绝对URL。

        无论图像是否存在,此方法始终立即返回。 当applet尝试在屏幕上绘制图像时,将加载数据。 绘制图像的图形基元将在屏幕上逐渐绘制。

        参数
        url - 提供图像位置的绝对URL。
        结果
        指定URL处的图像。
        另请参见:
        Image
      • getApplet

        Applet getApplet​(String name)
        Deprecated.
        使用给定名称查找并返回此applet上下文所表示的文档中的applet。 可以通过设置name属性在HTML标记中设置name
        参数
        name - 小程序名称。
        结果
        具有给定名称的applet,如果找不到 null
      • getApplets

        Enumeration<Applet> getApplets()
        Deprecated.
        查找此applet上下文所代表的文档中的所有applet。
        结果
        此applet上下文所代表的文档中所有applet的枚举。
      • showDocument

        void showDocument​(URL url)
        Deprecated.
        请求浏览器或applet查看器显示url参数指示的Web页面。 浏览器或小程序查看器确定显示网页的窗口或框架。 非浏览器的applet上下文可能会忽略此方法。
        参数
        url - 提供文档位置的绝对URL。
      • showDocument

        void showDocument​(URL url,
                          String target)
        Deprecated.
        请求浏览器或applet查看器显示url参数指示的Web页面。 target参数指示文档在哪个HTML框架中显示。 目标参数解释如下: Target arguments and their descriptions Target Argument Description "_self" Show in the window and frame that contain the applet. "_parent" Show in the applet's parent frame. If the applet's frame has no parent frame, acts the same as "_self". "_top" Show in the top-level frame of the applet's window. If the applet's frame is the top-level frame, acts the same as "_self". "_blank" Show in a new, unnamed top-level window. name Show in the frame or window named name. If a target named name does not already exist, a new top-level window with the specified name is created, and the document is shown there.

        applet查看器或浏览器可以忽略showDocument

        参数
        url - 提供文档位置的绝对URL。
        target - String指示显示页面的位置。
      • showStatus

        void showStatus​(String status)
        Deprecated.
        请求参数字符串显示在“状态窗口”中。 许多浏览器和applet查看器都提供了这样一个窗口,应用程序可以通知用户当前状态。
        参数
        status - 要在状态窗口中显示的字符串。
      • setStream

        void setStream​(String key,
                       InputStream stream)
                throws IOException
        Deprecated.
        将指定的流与此applet上下文中的指定键相关联。 如果applet上下文先前包含此键的映射,则替换旧值。

        出于安全原因,每个代码库都存在流和键的映射。 换句话说,来自一个代码库的applet无法访问来自不同代码库的applet创建的流

        参数
        key - 与指定值关联的键。
        stream - 要与指定密钥关联的流。 如果此参数为null ,则在此applet上下文中删除指定的键。
        异常
        IOException - 如果流大小超过特定大小限制。 大小限制由此接口的实现者决定。
        从以下版本开始:
        1.4
      • getStream

        InputStream getStream​(String key)
        Deprecated.
        返回在此applet上下文中与指定键关联的流。 如果applet上下文不包含此键的流,则返回null

        出于安全原因,每个代码库都存在流和键的映射。 换句话说,来自一个代码库的applet无法访问来自不同代码库的applet创建的流

        参数
        key - 要返回其关联流的密钥。
        结果
        此applet上下文映射密钥的流
        从以下版本开始:
        1.4
      • getStreamKeys

        Iterator<String> getStreamKeys()
        Deprecated.
        在此applet上下文中查找流的所有键。

        出于安全原因,每个代码库都存在流和键的映射。 换句话说,来自一个代码库的applet无法访问来自不同代码库的applet创建的流

        结果
        此applet上下文中所有流名称的迭代器。
        从以下版本开始:
        1.4