【发布时间】:2009-10-03 18:38:58
【问题描述】:
给定一个JApplet,如何获取这个applet对应的JFrame对象?
JApplet applet = this;
JRootPane rootPane = getRootPane();
Container contentPane = getContentPane();
JFrame jframe = ...; // How do I obtain the JFrame?
【问题讨论】:
-
试图在 JFrame 中运行小程序?
-
Omry:不,我有假定访问 JFrame 的代码。我希望这个 JFrame 成为“JApplet 窗口”。创建一个新的 JFrame 将不起作用,因为这将创建一个新窗口。