I am testing it localy.
my HTM lookes like this
<HTML>
<BODY>
<APPLET CODE="GeomApplet.class" WIDTH="353" HEIGHT="207" >Your browser is
not Java enabled.
</APPLET>
</BODY>
</HTML>
My applet is in a package and looks like this
package anApplet;
import java.applet.*;
import java.awt.Graphics;
public class GeomApplet extends Applet {
public void paint (Graphics g)
{
double a=2;
double b=3;
Kvadrat Kv=new Kvadrat();//a class in the same package
Krug Kr = new Krug();// a class in the same package
Kv.setStr(a);
Kr.setR(b);
g.drawString("Povrsina kvadrata je " +Kv.povrsina(),10,50);
}
}
All classes and the HTM page ar ina a folder(package) called anApplet
> I am testing it localy.
You can be testing it locally, but debugging it on
the web. It is much easier for everybody else that
is *helping* you.
> my HTM lookes like this
> <HTML>
>
> <BODY>
>
> <APPLET CODE="GeomApplet.class"
CODE="anApplet.GeomApplet.class"
>...WIDTH="353" HEIGHT="207" >Your browser is
> not Java enabled.
...
> My applet is in a package
..because your applet is in a package, you need to
put it in a directory the same name as the package.
...
> Kvadrat Kv=new Kvadrat();//a class in the same package
> Krug Kr = new Krug();// a class in the same package
These classes also need to uploaded to the same package directory.
Applets that reside in packages and have multiple classes are much
more reliable and easier to administer if you jar them into a
single file.
> All classes and the HTM page ar ina a folder(package) called anApplet
..No! put the .html in the directory *above* 'anApplet'
package and it should find the class OK.
BTW - this is an applet that can be made to run
on the MSVM theat you were using earlier, but
that is more advanced.

Signature
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
polilop - 20 Jun 2005 00:38 GMT
I've placed my HTML outside the package and still errors then noticed that
in my HTML i wrote
CODE="anApplet/GeomApplet.class"
and my console thinks that GeomApplet is another
folder and in that folder is searching for a class.class file
so i just wrote
CODE="anApplet/GeomApplet" and now works fine
tried to put the HTML back into the package and it dosent work just as you
said.
Thx alot for the help.
By the way you mentioned a post before that MSVM is more advanced? is that
mean its better then JVM or that the code to write in for the MSVM is more
advanced (for this case)?
Andrew Thompson - 20 Jun 2005 00:55 GMT
> By the way you mentioned a post before that MSVM is more advanced?
No way I said that. (Ever!)
The MSVM (Java 1.1) is about 10 years old and cannot do
lots of things that modern JVM's can do. But there is nothing
in your code that was not in Java 1.1 - so your applet could
run on anything *from* the ancient MSVM, up to the latest
1.5 Java.
If your code can also work in Java 1.1, it makes sense
to ensure it *does* work in 1.1 VM's. That is what I meant.

Signature
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane