views:

30

answers:

2

My Java Swing application has an animated playback of a poker hand. I'd like to let users record this playback so that it can be sent to other people and played back in, for example, QuickTime.

Any ideas how to go about recording a Swing JFrame over time?

+1  A: 

If you want a stand-alone video, you will need to do screen capture and encode it to a movie.

You can use the java.awt.Robot classes to capture the window as seen by the user, and do it frequently enough to get a reasonable framerate. I am unfortunately not familiar with a tool that can encode frames to video under Java.

Thorbjørn Ravn Andersen
A: 

JMF should be capable of doing so. Here is a tutorial about how to do screen grabbing and encoding with JMF.

tulskiy