Help coderanch get a
new server
by contributing to the fundraiser
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reading A file from an Applet

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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());

*/
 
I have always wanted to have a neighbor just like you - Fred Rogers. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic