You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The program I'm intending to use with CheerpJ uses Swing file choosers for input in the form of XML files and other things. It doesn't appear to me that CheerpJ includes functionality for selecting a file from the user's computer outside of the sandboxed virtual filesystem outlined in the documents. That is, when opening a file chooser within the program, the virtual filesystem is displayed and only files within that can be selected.
How would one go about allowing users to select files from their local machine, such as from their Downloads or Documents folder? Would additional javascript need to be written to allow for this type of interaction with CheerpJ?
The text was updated successfully, but these errors were encountered:
The best strategy is to write a small amount of JS code to get native access to the browser file selection dialog. The file data can be passed as a Java byte[] to Java code using CheerpJ interop APIs. The general idea would be
// Assuming 'fileBuffer' is an Int8Array created from file datavarjavaByteArray=cjTypedArrayToJava(fileBuffer);cjCall("SomeClass","parseXMLData",javaByteArray).then(function(ret){/* Do something with returned data*/});
The program I'm intending to use with CheerpJ uses Swing file choosers for input in the form of XML files and other things. It doesn't appear to me that CheerpJ includes functionality for selecting a file from the user's computer outside of the sandboxed virtual filesystem outlined in the documents. That is, when opening a file chooser within the program, the virtual filesystem is displayed and only files within that can be selected.
How would one go about allowing users to select files from their local machine, such as from their Downloads or Documents folder? Would additional javascript need to be written to allow for this type of interaction with CheerpJ?
The text was updated successfully, but these errors were encountered: