This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Applets and the fly likes JFrames Within Applets/JApplets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "JFrames Within Applets/JApplets" Watch "JFrames Within Applets/JApplets" New topic
Author

JFrames Within Applets/JApplets

colin shuker
Ranch Hand

Joined: Apr 11, 2005
Posts: 744
Hi, I have a class that extends JFrame, and this has components,
which extend JPanels and so on.

I wanted to put my application into an applet.
I know Applet has its own paint() method, but all I want to do is
do this from with the JPanels inside my JFrame.
Can I just put a JFrame into an Applet, without having to change my code?

Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41036
    
  43
An applet can certainly open a window (which is what JFrame is). It may need to be a JApplet instead of an Applet, I'm not sure.


Ping & DNS - my free Android networking tools app
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JFrames Within Applets/JApplets
 
Similar Threads
Swing
How to convert Applet program into an Exe
Swing
JMenu
validate(), remove()- what do they REALLY do?