We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Java File in P5 (Read 890 times)
Java File in P5
Jul 23rd, 2005, 7:22pm
 
Since I can't export from eclipse I brought the project (just 3 classes) in p5 to export from there.
I'm finding some problem to set the path to load files because I'm using java functions:

Code:
File dir = new File("colors"); 



Instead on going to check "colors" file (in this case it is a folder) inside "data" it goes to C:\Program Files\processing-0091-expert\colors

I solved putting the absolute path but then if I export of course I get a filenotfound error. How to solve it?

thx, chr


Re: Java File in P5
Reply #1 - Jul 23rd, 2005, 9:15pm
 
use loadStrings(), loadBytes() or openStream() (see the ref for details). use "add file to sketch" to add the file to your project's data folder, which will cause it to be exported with things.

if you need the path to the sketch folder, that exists as a variable called "folder" but that won't help for exporting online.
Re: Java File in P5
Reply #2 - Jul 23rd, 2005, 9:23pm
 
So I'm f****d Sad In the sense that I've to change the File converter (reading and also parsing). I will wait then because I'm not sure I want do compromise the compatibility (structure) in Eclipse. I'll try the add file feature. Thanks ben!
Re: Java File in P5
Reply #3 - Jul 23rd, 2005, 11:54pm
 
It sgould be really easy to make the jar yourself instead of using the eclipse export function. You can probaly just export the applet using eclipse and manually copy the processing core class library into it, that might be all that you need to do.

Since a jar-file is a ZIP-file you can rename it to .ZIP and look into it. Compare the contents of a eclipse exported applet and a simple export of a simple processing applet and tou might be able to figure it out.

Re: Java File in P5
Reply #4 - Jul 24th, 2005, 2:36am
 
Ye, but don't I need a static "main" function in my PApplet? Have u ever tried? I used the exported for the last version by Toxi and didn't work, thatn I checked and the MANIFES.MF was wrong, but also having fixed it it doesn't work.
Re: Java File in P5
Reply #5 - Jul 24th, 2005, 2:46am
 
The "add File" option is interesting, but a part moving the file in the folder what does it do? Is it not possible to add a folder? I have 447 files in the folder and I'm getting the names with the dir.list() java function :S
Re: Java File in P5
Reply #6 - Jul 24th, 2005, 3:12am
 
oh, I misunderstood your question as well Smiley I'm coding close to a deadline so my mind is always on the code Smiley
Page Index Toggle Pages: 1