converting applications to applets

Hi,

For a standalone application, I wrote a Java class which extends JFrame. When I execute it, it works well, the content I want to display appears as a pop-up window. Now, I want to display the same content in the web browser as an applet. Searching on the internet, I thought I found the way to implement it. I built a new class RunApplet in a file RunApplet.java as below:

import java.awt.*;

import java.applet.*;

public class RunApplet extends Applet {

public void init() {

GameGUI myA = new GameGUI();

myA.setVisible(true);

}

}

GameGUI is my class which extends JFrame. Then I wrote an htm file as below:

<html>

<head><title>Network Project</title></head>

<body>

<applet code="RunApplet.class" width=750 height=700></applet>

</body>

</html>

When I write the URL in address bar, there is displayed nothing on web browser. It says Applet is started, however no content is displayed. What is wrong with my code? Any ideas?..

My knowledge of Java is really limited..I really need help..Thanks..

[1171 byte] By [safisha] at [2007-11-27 4:55:26]
# 1
See the Java Console messages on your browser. What they say?For example, if your JFrame application has the line:setDefaultCloseOperation(EXIT_ON_CLOSE);delete the line and recompile.
hiwaa at 2007-7-12 10:10:23 > top of Java-index,Java Essentials,Java Programming...
# 2

Safish, don't double post. I have given you an answer in your post [url=http://forum.java.sun.com/thread.jspa?threadID=5174508&messageID=9673376#9673376]here[/url]. You need to study up on applets and how they are different than applications. Please go to the site that I referenced in my post. After you learn the difference, you can change the code. It will probably be pretty simple then.

Good luck.

petes1234a at 2007-7-12 10:10:23 > top of Java-index,Java Essentials,Java Programming...
# 3
But the OP's approach is basically viable if the JFrame app is written properly for applet-wise.
hiwaa at 2007-7-12 10:10:23 > top of Java-index,Java Essentials,Java Programming...
# 4
Yes it is. Something is wrong in the other app, probably.
petes1234a at 2007-7-12 10:10:23 > top of Java-index,Java Essentials,Java Programming...