void runExternalCommand() {
String runCmd = "cmd /c start \"\" ffmpeg --help";
try {
Runtime.getRuntime().exec(runCmd);
}
catch(IOException e) {
println("runExternalCommand: IOException:" + e);
}
}
opening in new window or as supbrocess:
https://stackoverflow.com/questions/615948/how-do-i-run-a-batch-file-from-my-java-application/616014#616014
saving and loading variables from file
varijanta s podrskom za UTF-8
—
void fileWrite (String filename, String filecontent) {
BufferedWriter output = null;
try {
output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filename, true), "UTF-8"));
output.write(filecontent);
}
catch (IOException e) {
println("Error writing to file");
e.printStackTrace();
}
finally {
if (output != null) {
try {
output.close();
}
catch (IOException e) {
println("Error closing the writer");
System.out.println(e.getMessage());
}
}
}
}
—
kompilirano odavde:
http://stackoverflow.com/questions/1625234/how-to-append-text-to-an-existing-file-in-java
http://stackoverflow.com/questions/6998905/java-bufferedwriter-object-with-utf-8
tool designed for Java and Processing developers who want to package multiple jar, class, external, and native files up into a single self-extracting jar
"If you use 32-bit and 64-bit browsers interchangeably, you will need to install both 32-bit and 64-bit Java in order to have the Java plug-in for both browsers"
loadaj ga u setup funkciji.
https://forum.processing.org/topic/problem-with-loadstrings-file-txt
testiranje da li je string int
....
public boolean isNumeric(String input) {
try {
Integer.parseInt(input);
return true;
}
catch (NumberFormatException e) {
// s is not numeric
return false;
}
}
"A very common mistake that lots of Java programmers will make is to use "==" to compare strings, rather than ".equals".
Strings are objects!