How can I record a Java Swing GUI as a video file on Mac OS X?
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.
开发者_JS百科Any ideas how to go about recording a Swing JFrame over time?
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.
JMF should be capable of doing so. Here is a tutorial about how to do screen grabbing and encoding with JMF.
精彩评论