knorv
knorv

Reputation: 50117

Obtaining a JFrame from a JApplet

Given a JApplet, how do I obtain the JFrame object corresponding to this applet?

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

Upvotes: 0

Views: 868

Answers (1)

Pierre
Pierre

Reputation: 35246

You can create a new JFrame from an Applet. But there is no container like a JFrame surrounding an Applet. The Applet is ths container.

Upvotes: 3

Related Questions