Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Strange problem occurred while using IO from java Applet

Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

[ January 30, 2006: Message edited by: YuenLian Wu ]
Posts: 43027
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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()); }

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic