Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
给定一个JApplet,如何获取这个applet对应的JFrame对象?
JApplet applet = this; JRootPane rootPane = getRootPane(); Container contentPane = getContentPane(); JFrame jframe = ...; // How do I obtain the JFrame?
您可以从 Applet 创建一个新的 JFrame。但是没有像 JFrame 这样围绕 Applet 的容器。Applet就是容器。