Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Search Applet

 
Jon Davies
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
 
Alex Belt
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic