Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Reading A file from an Applet

 
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
 
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.
 
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());

*/
 
Switching from electric heat to a rocket mass heater reduces your carbon footprint as much as parking 7 cars. Tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic