How can I debug or run a class that extends java.applet.Applet
? I am able to run the applet from the command line with appletviewer.
appletviewer runapp.html
Here is what class looks like:
import java.awt.Graphics;
import java.applet.Applet;
public class FancyApplet extends Applet {
@Override
public void paint(Graphics g) {
g.drawString("Hello World!", 20, 20);
}
}
Here is what the HTML file looks like
<!doctype html>
<head>
<meta charset="utf-8">
<title>A Fancy Applet</title>
</head>
<object type="application/java" width="200" height="300">
<param name="code" value="FancyApplet.class">
</object>
How do I have to organize those files within my project and what settings do I have to use to debug the Applet in NetBeans? The thread Running a java applet from netbeans? did not help unfortunately. I did what was suggested, but get a message telling me that the main class was not found. What I took from it though was that in my case the HTML file is not even needed? But just because I am curious is it still possible or recommended to use it?