I don't like Netscape

Question- my simple applet won't run in Netscape. The error (when I run my mouse over where the applet should be) says "Applet can't start...Class not found"

This is my html code:

<APPLET CODE="DietDiary.class"WIDTH=364 HEIGHT=225>

</APPLET>

and the DietDiary Class is in same directory as HTML page.

What the heck is going on?

Thank you!!!! :)

[415 byte] By [pepsivscoke] at [2007-9-26 4:11:58]
# 1
Did you paste the code or type it? - if you pasted it, then put a space between CODE="DietDiary.class" and WIDTH=364
mattbunch at 2007-6-29 13:17:27 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 2
I tried that but to no avail : (
pepsivscoke at 2007-6-29 13:17:27 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 3
Is it just Netscape or does it work in appletviewer or IE? You are not extending that applet from JApplet?
jsalonen at 2007-6-29 13:17:27 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 4

Hi Jennifer! Is that the entire HTML code? If so, try the following.

<html>

<head>

</head>

<body>

<applet codebase="." code=DietDiary.class width=364 height=225>

</applet>

</body>

</html>

BTW, I am assuming that "DietDiary" matches the classname absolutely, including the case.

Hope this helps!

Cheers!

amolk at 2007-6-29 13:17:27 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 5
works fine in IE and below is my initial java code:import java.applet.*;import java.awt.*;import java.awt.event.*;public class DietDiary extends Applet implements ItemListener, ActionListener {Thanks!
pepsivscoke at 2007-6-29 13:17:27 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 6

Check the console: *which* class is not found? DietDiary itself or some class that DietDiary uses?

Also note that having the .class extension is not necessary - it may even make NN search for a class called "DietDiary.class", that is, a class named "class" in the package "DietDiary".

jsalonen at 2007-6-29 13:17:27 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 7

Ugh...still not working.

DietDiary class is the one Netscape is looking for and I didn't declare any others within DietDiary.java. The exact message is: "Applet DietDiary can't start class DietDiary not found"

Here's my full HTML code:

<HTML>

<HEAD>

</HEAD>

<BODY bgcolor="#FFFFFF">

<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">

<TR>

<TD COLSPAN="3"><IMG SRC="images/1.gif" width="778" height="160"></TD>

</TR>

<TR>

<TD><IMG SRC="images/2.gif" width="184" height="268"></TD>

<TD>

<APPLET CODE=DietDiary WIDTH=364 HEIGHT=225>

If you can read this......(will be replaced with other content)

</APPLET>

</TD>

<TD><IMG SRC="images/3.gif" width="228" height="268"></TD>

</TR>

<TR>

<TD COLSPAN="3"><IMG SRC="images/4.gif" width="778" height="222"></TD>

</TR>

</TABLE>

</BODY>

</HTML>

Any more tips would be greatly appreciated!

Thank you

pepsivscoke at 2007-6-29 13:17:27 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 8
And the same thing still works in IE?
jsalonen at 2007-6-29 13:17:27 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 9
Hi Jennifer! Have you tried adding codebase="." to the applet tag?Cheers!
amolk at 2007-6-29 13:17:27 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 10
you have to use the object tag or embeded ( i forget which is for netscape )
haroldsmith at 2007-6-29 13:17:27 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 11

First, here is a good informational link :

http://java.sun.com/products/plugin/1.2/docs/tags.html

You might want to look at using the Java Plug-in if you are going to widely distribute your applet.

Now for my editorial :-)

Just because you chose to use IE as your initial platform does not make Netscape broken or bad. It is just different. If you had chosen Netscape first, then you would have the same issues converting to IE. Unfortunately these rival browsers continue to do some things very differently and we as developers have to deal with it. It is important, in my opinion, to take the time to make sure your applications/web pages/applets work in MOST major browsers, why limit your audience? I personally LIKE Netscape, but I dislike the title of this thread. :-)

eicheled at 2007-6-29 13:17:27 > top of Java-index,Archived Forums,New To Java Technology Archive...