• Post Reply Bookmark Topic Watch Topic
  • New Topic

Strange problem occurred while using IO from java Applet

 
YuenLian Wu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am currently encountering a very depressing issue, and I hope you guys can help me out.

I am using IBM WSAD, and I wrote a function to write all the data from object to a file. This function works fine except calling from Applet.

Here is one of the function of my program named "BookStoreIOHandler":




I tried to call it from applet, and the program dead at the code says
"bw = new BufferedWriter(new FileWriter(filepath));", and it didn't throw any exceptions, but it just can't go on to read the next line of code. It just terminated at that particular line.

what I do in my applet is just:





why it will dead ? why?

Thanks in advance

Transistor
[ January 30, 2006: Message edited by: YuenLian Wu ]
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Applets can't access the local file system; they need to be especially enabled to do so. The details about this can be found here.

The reason you're not seeing the respective exception message is that
} catch (Exception e) { e.getMessage(); }
catches the exception but doesn't report it. Instead, try
} catch (Exception e) { System.out.println(e.getMessage()); }
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!