0

给定一个JApplet,如何获取这个applet对应的JFrame对象?

JApplet applet = this;
JRootPane rootPane = getRootPane();
Container contentPane = getContentPane();
JFrame jframe = ...; // How do I obtain the JFrame?
4

1 回答 1

3

您可以从 Applet 创建一个新的 JFrame。但是没有像 JFrame 这样围绕 Applet 的容器。Applet就是容器。

于 2009-10-03T10:38:58.270 回答