开发者

How can I record a Java Swing GUI as a video file on Mac OS X?

开发者 https://www.devze.com 2023-01-14 20:30 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消