This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes calling JFrame in JApplet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "calling JFrame in JApplet" Watch "calling JFrame in JApplet" New topic

calling JFrame in JApplet

Beena Thomas

Joined: Sep 26, 2001
Posts: 5
Is it possible to call a JFrame inside a JApplet and how is it.
When i tried it is showing java.lang.IllegalArgumentException: adding a window to a container.

Can anyone help me with this
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Beena,
Yes you can create a new JFrame from within a JApplet.

Will do it. However, your error seems to relate to you trying to place a Frame into an Applet. This is not allowed because an Applet is a container while a Frame is a window. If you just want a container inside an APplet then you should use a Panel.
Beena Thomas

Joined: Sep 26, 2001
Posts: 5
Thanks Manfred.
If that is the case is it possible to use an instance of JPanel having a JFileChooser added to its contentpane get displayed in a JApplet.
I would appreciate your response
I agree. Here's the link:
subject: calling JFrame in JApplet
Similar Threads
heavy wt components
Image in JFrame which opens from a JApplet
JApplet to JApplet Communication
why JROOT pane