Forums Register Login

Newbie Help Please.

+Pie Number of slices to send: Send
Hello I just began learning java just a couple days ago, [it is basicly my first language] I seem to have a problem with this tutorial on applets (my applet is broken :tear: ) http://www.mandomartis.com/onlinecourses/basicgamedev/chapter2/chapter2.html

It tells me to compile this to a class....




and make an html of this and then open the html

<HTML>
<HEAD><TITLE>My first applet</TITLE></HEAD>
<BODY>
<APPLET CODE="myapplet.class" WIDTH=100 HEIGHT=100>
</APPLET>
</BODY>
</HTML>

It appears I am getting an error because I do not have a main class but I am not shure, I am doing exactly as the tutorial says is there something I should add. And if it is the main class how and where should I add it.

All help is greatly appreciated,

Regards, iMi

*added* I think it is the html maybye but I do not know as I have no Idea
[ March 28, 2007: Message edited by: Don AnthraX ]
+Pie Number of slices to send: Send
hi,
did you compile the code successfully.
if so a class file will be generated in the directory where the java file is.
In the HTML you have to give the path of the class file or just mention the class file(myapplet.class), if the class file is in the same directory as the HTML page.

The error is because the HTML page could not fine the required class file.

regards,
Arjun
+Pie Number of slices to send: Send
Welcome to JavaRanch.

On your way in you may have missed that we have a policy on screen names here at JavaRanch. Basically, it must consist of a first name, a space, and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do right here.

As to your question, first thing is to make sure that Java in installed correctly in your browser. See if you can run any applets from this page. If you can, then the code you poasted should work, provided you have the myapplet.class file in the same directory as the HTML file.

No further class (named "main" or otherwise) is needed.
Yeah, but is it art? What do you think tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 877 times.
Similar Threads
Applet .....need help to run the applet
viewing applet in IE
applet help please
Problems while Loading Applet...
I/O exception while reading: C:\-classpath..?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 02:20:59.