OK, moved here since it uses the standard library.
I don't have a camera, so I cannot test the code. Perhaps somebody else can confirm.
Indicating which platform you use can help too, perhaps this behavior is related to your system.
A solution might be to show a button "click here to start", perhaps...
Also, perhaps try:
frame.requestFocus();
in setup().
I don't have a camera, so I cannot test the code. Perhaps somebody else can confirm.
Indicating which platform you use can help too, perhaps this behavior is related to your system.
A solution might be to show a button "click here to start", perhaps...
Also, perhaps try:
frame.requestFocus();
in setup().