有没有办法从小程序本身重新加载/刷新 Java 小程序? [英] Is there a way to reload/refresh a java applet from within the applet itself?

查看:22
本文介绍了有没有办法从小程序本身重新加载/刷新 Java 小程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的小程序上有一个按钮(包含在浏览器中),我想通过以下两种方式之一重新加载或刷新整个小程序:

I have a button on my applet (contained in a browser) that I would like to make reload or refresh the entire applet one of two ways:

  1. 无需刷新浏览器即可刷新小程序本身
  2. 刷新整个浏览器

这可以从小程序内部实现吗?

Is this possible from within the applet?

推荐答案

使用 AppletContext.showDocument(...) 方法:

Use the AppletContext.showDocument(...) method:

applet.getAppletContext().showDocument(applet.getDocumentBase(), "_self")

这将在已经加载小程序的同一窗口/框架中加载包含小程序的文档.

That will load the document containing the applet in the same window/frame the applet is already loaded in.

这篇关于有没有办法从小程序本身重新加载/刷新 Java 小程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆