M
Marcus P
Hello!
I use J2skd 1.4.2 on windows 2000.
I try to read text from a .txt-file on the same server as my applet with the
following code:
int character;
BufferedInputStream bin;
try{
URL fil= new URL("URLToMyTextfile");
bin= (BufferedInputStream)fil.getContent();
while((character=bin.read())>0)
presenteradText=presenteradText+((char)character).toString;
}
catch(MalformedURLException e){
System.out.println(e);
}
catch(IOException ioe){
System.out.println(ioe);
}
presenteradText ia a String.
javac compiles the code ok but when I run my applet I get ClassCastException
error.
Please help me with this one!!
Many thanks in advance!!
Marcus
I use J2skd 1.4.2 on windows 2000.
I try to read text from a .txt-file on the same server as my applet with the
following code:
int character;
BufferedInputStream bin;
try{
URL fil= new URL("URLToMyTextfile");
bin= (BufferedInputStream)fil.getContent();
while((character=bin.read())>0)
presenteradText=presenteradText+((char)character).toString;
}
catch(MalformedURLException e){
System.out.println(e);
}
catch(IOException ioe){
System.out.println(ioe);
}
presenteradText ia a String.
javac compiles the code ok but when I run my applet I get ClassCastException
error.
Please help me with this one!!
Many thanks in advance!!
Marcus