File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes Applet to read text Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet to read text" Watch "Applet to read text" New topic

Applet to read text

Bahadir Mert Uzan

Joined: Mar 27, 2009
Posts: 13
Hi there Java Gurus

I am bombing you with questions but I need help

I read a text file using a class called scanner and then build objects using the information(Text is in the same folder with class files)
Then I build a various list to send it into my JPanel.
Then I build an JApplet that holds my panel, when I start the project it runs smoothly but when i put into an html page
scanning class causes an error and cant find the text file.
I understand that this is a security feature of applets but how can I get rid of it.
My applet simply adds panel which uses 4 other objects and swing feautures and nothing more.
Also the web page is just this

Thanks and more thanks if you can send me codes
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Where is the file located? If it's on the client then you'll indeed need to sign the applet (see HowCanAnAppletReadFilesOnTheLocalFileSystem for details). If it's on the server -and it sounds more like that might be the case- then no signing is needed; see HelloServerFile for an example.
Bahadir Mert Uzan

Joined: Mar 27, 2009
Posts: 13
Thank you very much for the details. I though i was doing that by using different classes. I had my own class that does the scanning but they couldn't do it. Instead I follow server method and let applet read the file and send it to scanner.
I agree. Here's the link:
subject: Applet to read text
It's not a secret anymore!