-
Smiley Face
Hello There,
I am trying to create a smiley face using Japplet, but nothing comes up when I run the program
here are my codes
import java.awt.*;
import java.applet.*;
public class NewJApplet2 extends Applet {
public void paint(Graphics g)
{
g.setColor(Color.yellow);
g.fillOval(50, 50, 75, 75);
g.setColor(Color.black);
g.fillOval(65, 70, 15, 15);
g.fillOval(95, 70, 15, 15);
g.drawArc(70, 90, 40,15, 180, 180);
}
}
Please advise what should i modify
-
Re: Smiley Face
How are you running your applet? How big is it? What do you see?
-
1 Attachment(s)
Re: Smiley Face
Thank you for your interest to help me:
1. I am trying to run the applet through my IDE ( Netbeans and Jcreator )
2 .the applet is not big: it should occupy a quarter of the screen max.
3. I will attach a screenshot for the dislay
-
Re: Smiley Face
I'd recommend putting a print statement in your paint method to figure out whether it's ever actually being called.
-
Re: Smiley Face
Where does the "Welcome to Java!" text in your screenshot come from? I suspect that you have some old .class file lying on the classpath, and haven't compiled the new NewJApplet2.
db