Hello all,
I'm trying to practice some java every day, to eventually do some actual work in it! In running applets, one option to test them is to place them in a basic html page and run appletviewer, or load the page from a browser (I assume IE can process applets to the same degree as Netscape??). However, I can't get this one running:
import java.awt.*;
import java.applet.Applet;
public class SimplePaint extends Applet {
public void paint(Graphics g) {
g.setColor(Color.black);
g.fillRect(0,0,300,300);
g.setColor(Color.white);
g.fillOval(30,30,50,50);
}
}
I know the html code is fine, but I'll post it anyway...
<HTML>
<HEAD>
<TITLE> A Simple Program </TITLE>
</HEAD>
<BODY>
Here is the output of my program:
<APPLET CODE="SimplePaint.class" WIDTH=150 HEIGHT=25>
</APPLET>
</BODY>
</HTML>
When I run it either way, it doesn't produce what's expected- a white oval on black background. Can you help me out?
thnx!!
I'm trying to practice some java every day, to eventually do some actual work in it! In running applets, one option to test them is to place them in a basic html page and run appletviewer, or load the page from a browser (I assume IE can process applets to the same degree as Netscape??). However, I can't get this one running:
import java.awt.*;
import java.applet.Applet;
public class SimplePaint extends Applet {
public void paint(Graphics g) {
g.setColor(Color.black);
g.fillRect(0,0,300,300);
g.setColor(Color.white);
g.fillOval(30,30,50,50);
}
}
I know the html code is fine, but I'll post it anyway...
<HTML>
<HEAD>
<TITLE> A Simple Program </TITLE>
</HEAD>
<BODY>
Here is the output of my program:
<APPLET CODE="SimplePaint.class" WIDTH=150 HEIGHT=25>
</APPLET>
</BODY>
</HTML>
When I run it either way, it doesn't produce what's expected- a white oval on black background. Can you help me out?
thnx!!