• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading A file from an Applet

 
AndrewNisbet
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am tring to write a ticker applet that will display prices of certain stocks. I have created an application that writes the symbols and prices to a text file stored in the same directory as the applet class. How can a setup the applet to read the data from the file???
Thanks
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Andrew,
After you have coded the applet to read the file, you will need to sign it because reading files from an applet is playing outside the sandbox.
This link might help you:
http://developer.java.sun.com/developer/Books/JAR/sign/

Regards,
Manfred.
 
Mayur Agrawal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I loaded java propery object reading a server side properties file.here is the code.
/*
appletCommands = new Hashtable();
AppletController controller = (AppletController) AppletReferences.getApplet(AppletConstants.APPLET_CONTROLLER);
String path = controller.getCodeBase().toString();
path = path + "appletCommands.properties";
URL url = new URL(path);
Properties prop = new Properties();
prop.load(url.openConnection().getInputStream());

*/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic