Article View: borland.public.jbuilder.java.language
Article #15464Re: PROBLEMS WITH writeObject
From: tupper
Date: Tue, 15 Jun 1999 00:00
Date: Tue, 15 Jun 1999 00:00
45 lines
2340 bytes
2340 bytes
It's because you're not allowed to access files in applets. Change it
to an application and see if it works.
In article <7k3s2m$g7b$1@mailint03.im.hou.compaq.com>,
"MJR" <Rao.Mohith@compaq.com> wrote:
> Can anyone tell me why the following simple applet produces a
> com.ms.security.SecurityException... every time it is brought up?
>
> import java.awt.*;
> import java.applet.*;
> import java.io.*;
>
> public class Test extends Applet {
>
> public void init() {
> try {
> FileOutputStream out = new FileOutputStream( "testing.dat"
);
> ObjectOutputStream oos = new ObjectOutputStream( out );
> oos.writeObject( "testing" );
> oos.flush();
> oos.close();
> FileInputStream in = new FileInputStream( "testing.dat" );
> ObjectInputStream inStream = new ObjectInputStream( in );
> String t = (String) inStream.readObject();
> inStream.close();
> Panel p = new Panel();
> p.add( new Label( t ) );
> add( "Center", p );
> setSize( 400, 100 );
> setVisible( true );
> }
> catch (Exception e) {
> System.err.println(e);
> System.exit(1);
> }
> }
>
> }
>
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Technical Details
Message-ID:
<7k48fn$8au$1@nnrp1.deja.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7k3s2m$g7b$1@mailint03.im.hou.compaq.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5d71,4ad6f7ebbc681875 X-Google-Attributes: gidf5d71,public X-Google-Thread: f74b3,4ad6f7ebbc681875 X-Google-Attributes: gidf74b3,public X-Google-Thread: 113ae9,4ad6f7ebbc681875 X-Google-Attributes: gid113ae9,public X-Google-Thread: fecd1,4ad6f7ebbc681875 X-Google-Attributes: gidfecd1,public From: tupper@my-deja.com Subject: Re: PROBLEMS WITH writeObject Date: 1999/06/15 Message-ID: <7k48fn$8au$1@nnrp1.deja.com> X-Deja-AN: 489630842 References: <7k3s2m$g7b$1@mailint03.im.hou.compaq.com> X-Http-Proxy: 1.0 x43.deja.com:80 (Squid/1.1.22) for client 142.73.136.94 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Tue Jun 15 00:58:35 1999 GMT Newsgroups: borland.public.jbuilder.java.language,comp.lang.java,comp.lang.java.api,comp.lang.java.help X-Http-User-Agent: Mozilla/4.07 [en] (Win95; I ;Nav)