Applet read/write files
Hi,
I have a problem to use getCodeBase to get the URL. Actually, I am pretty confused on running the applet in our intranet.
Let me explain my problem here, I have mapped a network drive(G:\personA) in my machine and my applet and all the files are in G:\personA\classes. In my coding, I have tried to specify my files paths such as G:\personA\classes\index.txt and I can run the applet without any problem either with Eclipse or from a web site http://personA//report.html. But the other members in this company cannot run this applet thro' this web site( http://personA//report.html). The problem is "No class found", can't find the path G:\personA\classes\index.txt.
So I decided to change my code by reading/writing files thro URL i,e : http://personA/classes, but when I run my applet, I got the following exception :
ava.lang.NullPointerException
at java.applet.Applet.getCodeBase(Applet.java:136)
at web.MyChart.readAndPrintData(MyChart.java:336)
at web.MyChart<init>(MyChart.java:113)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:617)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:546)
at sun.applet.AppletPanel.run(AppletPanel.java:298)
at java.lang.Thread.run(Thread.java:534)
does anybody knows how to solve this problem? Please...
Thanks,
Tiffany

