Search code examples
javaweb-applicationsappletscreenshot

Screen capture of a java applet


I'd like to "capture" a screenshot of what a java applet would currently look like if it were loaded, effectively screenshoting an applet without the use of a vdu.

The purpose of this is to display the image to a user that doesn't have a JVM. Lets assume the applet is a digital clock and has no requirement on user input. So what could be done is set up a pc connected to a vdu, open the applet, schedule a script to take a screenshot and upload the image. Clients could then access what the applet would look like at any given time without the requirement on a jvm.

It'd be such a hassle to have a pc running all the time etc. Surely this could be done somehow without a display.

Would it be possible to create a virtual display in a jvm that can render an applet and then take a screen capture?

If this were possible then perhaps a really high resolution display could be virtualized to create a very high resolution screenshot.


Solution

  • The ScreenImage class should handle this.