Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How do you convert a JFrame to an Applet?

807601Jan 18 2008 — edited Jan 18 2008
I'm trying to convert a JFrame to an Applet but nothing seems to be working. Here is a sample of the code I'm using...

public static void main(String args[])
{

Component applet = new Lab4c1c();

JFrame frame = new JFrame("My applet, as application");
frame.getContentPane().add(applet);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.show();



}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 15 2008
Added on Jan 18 2008
2 comments
187 views