selectInput() and selectFolder() issues
in
Programming Questions
•
1 year ago
Hey all
I'm working on a simple media player that takes in a directory or a file and plays it (obviously!). I'm having some issues with the selectInput and selectFolder methods. They seem to crash the whole app. What happens is that it runs once and when I closeout of it by selecting a file or canceling it causes a block of the app. is there a bug here or a better way of doing this that I don't know about? Or should i just go down the regular java path and dip out of processing for this?
Heres some code (its not all of it but this generally what happens):
I'm working on a simple media player that takes in a directory or a file and plays it (obviously!). I'm having some issues with the selectInput and selectFolder methods. They seem to crash the whole app. What happens is that it runs once and when I closeout of it by selecting a file or canceling it causes a block of the app. is there a bug here or a better way of doing this that I don't know about? Or should i just go down the regular java path and dip out of processing for this?
Heres some code (its not all of it but this generally what happens):
- String loadFile;
- void setup(){
- }
void draw(){- }
void mousePressed(){ - loadFile = selectInput();
- handleSelected();
- }
void handleSelected(){- if(loadFile == null){
- println("no file selected");
- }
- else{
- println(loadFile);
- }
- }
1