FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   fonts and files for applets?
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: fonts and files for applets?  (Read 239 times)
jedierikb

WWW
fonts and files for applets?
« on: Dec 15th, 2003, 2:16pm »

where do i place and reference fonts and other files for p5 applets?
 
i have tried putting them (a)in the applet directory, (b)in a data directory in the applet directory...  but no luck, the applet never initializes.
 
ANSWER ~~> ok, the data directory and its contents are bundled into the applet's jar file.  
 
NEXT QUESTION ~~> for creating data driven applets, how do you reference data which will either be (a) in the applet's directory or (b) in the applet's html as a parameter?  thanks.
 
ANSWERS ~~> (a) use the getParam("myData") method
(b)reference the file using the getCodeBase()+myDataFileName.  However, this throws an error, "java.security.AccessControlException: access denied (java.util.PropertyPermission false read)".  Anyone know how to get past this one?
« Last Edit: Dec 15th, 2003, 3:41pm by jedierikb »  
jedierikb

WWW
Re: fonts and files for applets?
« Reply #1 on: Dec 15th, 2003, 5:52pm »

when running as an applet, deep in the bowels of java i discovered that calling the static method:
 
Boolean.getBoolean( String checkMeOut ) throws:
java.security.AccessControlException: access denied (java.util.PropertyPermission true read)
 
not too sure what java is trying to read.  maybe it is checking with sun's monkeys if the parameter is, indeed, true.  more likely, it check a string called "true" in the java system prefs file or some such thing.  stupid.
 
any event, using this series of calls does work:
String checkMeOutS = "true";
Boolean verifyB = Boolean.valueOf(checkMeOutS);
boolean verify = verifyB.booleanValue();
« Last Edit: Dec 15th, 2003, 6:06pm by jedierikb »  
fry


WWW
Re: fonts and files for applets?
« Reply #2 on: Dec 15th, 2003, 5:55pm »

use param() to get the params from the applet tag.  
 
the one you're running into with the security permissions, those are the default System Properties object, whcih you aren't allowed to access from an applet.
 
and loadStrings, loadFont, etc. all load files from the "data" folder. if you want an InputStream from something inside the data folder, use loadStream().
 
Pages: 1 

« Previous topic | Next topic »