java applet using JSE no main class found

This is the code that I am using for a very simple applet from a basic Java book. I know i need a main class but Ive tried to put in the main method and it gives me errors. The error I get with the posted code is that when i try to run it there is no main class found. As i mentioned, I tried to put a main method in but no combination works? Is there someone out there that knows JSE?Could someone help me with the code I need to make this run in java studio enterprise? Thanks so much.

import javax.swing.JApplet;

import java.awt.*;

publicclass Einsteinextends JApplet{

publicvoid paint (Graphics page)

{

page.drawRect (50,50,40,40);

page.drawRect(60,80,225,30);

page.drawOval(75,65,20,20);

page.drawLine(35,60,100,120);

page.drawString("Out of clutter, find simplicity.", 110,70);

page.drawString("--Albert einstein",130,100);

}

}

[1314 byte] By [pberardi1a] at [2007-11-27 9:21:44]
# 1

I'm just learning about JApplet's myself, so this could be wrong but:

1) I'm not sure that you need a main method here. Rather, I think you need an init method.

2) You probably shouldn't be overriding the paint method without good reason (and from peeking at your code, I don't see good reason). Rather you should be overriding paintComponent.

3) Have a look at the Java JApplet tutorial located here:

http://java.sun.com/docs/books/tutorial/uiswing/components/applet.html

Anyone: please correct any mistakes.

petes1234a at 2007-7-12 22:15:44 > top of Java-index,Java Essentials,New To Java...
# 2
does anyone know how to run applets on Java Studio Enterprise?
pberardi1a at 2007-7-12 22:15:44 > top of Java-index,Java Essentials,New To Java...
# 3
> does anyone know how to run applets on Java Studio> Enterprise?the manual usually knows...
jwentinga at 2007-7-12 22:15:44 > top of Java-index,Java Essentials,New To Java...
# 4

> This is the code that I am using for a very simple

> applet from a basic Java book. I know i need a main

> class but Ive tried to put in the main method and it

> gives me errors. The error I get with the posted

oh?

1) an applet doesn't need a main method

2) you shouldn't get errors if you add one anyway, unless of course you make a mistake (or more than one).

> code is that when i try to run it there is no main

> class found. As i mentioned, I tried to put a main

> method in but no combination works? Is there someone

1) as already mentioned, applets don't need a main method.

2) what errors? You're probably doing something quite wrong but without more details it's impossible to tell what.

> out there that knows JSE?Could someone help me

nah. On Sun's Java forums?

jwentinga at 2007-7-12 22:15:44 > top of Java-index,Java Essentials,New To Java...