I want to be able to take a screenshot of a portion or all of the screen using Java. The generally accepted method of doing this to use the Robot class, but that doesn't work in this case. I have multiple transparent JavaFX stages on the screen, and any screenshot taken with the Robot class seems to treat them as completely opaque.
I have also tried having the program simulate the presses of Ctrl+PrtSc. I can't seem to get it to actually put the screenshot into the clipboard before the method finishes though, even if I attempt to have it wait until there is a picture in the clipboard.
Is there any more direct way of getting a screenshot? Anything specific to Swing/AWT, unfortunately, will not work.