Does all methods of Java.io and Java.lang work in Processing?
in
Programming Questions
•
2 years ago
Hi all,
I am quite new with Processing and is currently experimenting with input and output for my project.
Does all methods of Java.io and Java.lang work in Processing?
I have stumble across some that does not work. Am i doing something wrong or that some of the methods does not work with processing?
Codes attached below:
- String[] lines;
- void setup() {
size(300, 300);
print(java.lang.Math.floor(-20.5));
java.io.File f = new File("D:\\test");
String[] files = f.list();
println(files.length);
for (int i=0;i<files.length;i++){
println(files[i]);
}
java.io.File f2 = new File("D:\\test\\test.txt"); //works
print(f2);
print(f2.exists());
//java.io.FileWriter pw = new FileWriter(f2); //does not work
PrintWriter pw = createWriter(f2); //processing bit that works
pw.println("test");
pw.flush();
pw.close();
} - void draw() {
background(255);
}
-
Thanks for reading.
1