[4423] in java-interest

home help back first fref pref prev next nref lref last post

how to make use of 'package' in an applet environment ??

daemon@ATHENA.MIT.EDU (Eric Ho)
Fri Dec 22 20:23:47 1995

Date: Fri, 22 Dec 95 19:11:31 EST
From: eric@internet.sbi.com (Eric Ho)
To: java-interest-digest@java.sun.com

Greetings Everyone,

The JDK-beta docs aren't all that clear on how to make use the 'package'
statement in an applet environment.

For instance, I've this piece of code, in a file, Hello.java. :-
==============
package funstuff;

import java.applet.*;
// ..etc..

public class Hello extends Applet {  ..etc.. }
==============

Compilation went fine.  I got the resultant Hello.class file.

Now, my question here is that the object, Hello, is in the class 'funstuff',
right ?  So, the fully qualified name is funstuff.Hello, true ?

Well, where should I put this Hello.class file on my Web server ?

I'm trying to use appletviewer -- i.e.

        appletviwer http://myhost/eric/applets/Hello.html

My Hello.html contains :-

==================
<applet codebase="http://myhost/eric/applets" code="Hello.class"
 width=300 height=300 align=center>
</applet>
==========================================


Obviously, there's something wrong here but I don't know what it is.

The appletviewer complains (in its ClassLoader) that it can't find the class,
Hello.

If I comment out the 'package' statement, then everything went smoothly.

Any pointers/info much appreciated.

-Eric Ho-
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post