代码之家  ›  专栏  ›  技术社区  ›  Saiyine

从父小程序创建子小程序窗口

  •  1
  • Saiyine  · 技术社区  · 17 年前

    1 回复  |  直到 17 年前
        1
  •  1
  •   sblundy    17 年前

    您可以使用打开一个新窗口 AppletContext.showDocument() . 您需要在服务器上有一个包含HTML和所有内容的页面。您可以从applet获取上下文,它继承 getAppletContext() 来自基类。

    结果会是这样的:

    AppletContext ctxt = getAppletContext();
    ctxt.showDocument("http://www.example.com/child_applet.html", "_top");
    

    JFrame frame = new JFrame();
    // setup all the context...
    frame.show();