Hi everyone !

This is my first new post, I have a problem with my Java code. I am trying to make a first applet, and have gotten this code from a book, "Java - An Introduction To Problem Solving & Programming", by Walter Savitch and Frank Carrano :

import javax.swing.JApplet;
import java.awt.Graphics;
public class HappyFace extends JApplet
{
      public void paint(Graphics canvas)
      {
            canvas.drawOval(100, 50, 200, 200);
            canvas.fillOval(155, 100, 10, 20);
            canvas.fillOval(230, 100, 10, 20);
            canvas.drawArc(150, 160, 100, 50, 180, 180);
       }
}

Any ideas why I keep getting an error message coming from NetBeans 5.5.1 that it can't find "HappyFacemain.class" ? Thanks in advance !

-dtfan6

You named your class HappyFace, not HappyFacemain.

I have tried renaming the file, but it doesn't seem to help. Can it be done that way, or does it have to be named that before compiling? Thanks for responding, btw, jasimp. :)


....Scratch that last post, I think I see what you mean, jasimp. I'll try that.

I have tried renaming the file, but it doesn't seem to help. Can it be done that way, or does it have to be named that before compiling? Thanks for responding, btw, jasimp. :)

Scratch the last thing I wrote above ^^^I think I see what you mean, jasimp. I'll try that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.