Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Search Applet

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All!
I've written an applet to search through a phone list (text file). Originally this was written in Swing but I had problems with it being seen through web browsers. For firewall reasons, I decided to re-write the applet using AWT (instead of using Plug ins), but I am encountering the same problems. Basically, the applet is displayed, but when you click on search nothing happens. The error message starts as follows:
java.security.AccessControlException: access denied (java.io.FilePermission PhoneList.txt read)
I think that the problem is when it tries to read the text file of phone numbers.
The relevant piece of code is below:
public static Object[][] objectArrayFiller()
{
try
{
FileReader reader = new FileReader("PhoneList.txt");
nextChar = reader.read();
try
{
Am I trying to read the text file incorrctly? Is there a problem with doing this with an applet? I would be grateful of any advice or suggestions that anyone could give.
Many thanks,
Jon
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to your code, you're trying to read from the local file system. If that's the case, you need to sign the applet first. If not, you need to access the file on the server, but you need to access it as a resource rather than the way you have coded.
Alex
 
    Bookmark Topic Watch Topic
  • New Topic