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

折月煮酒 提交于 2019-12-10 23:46:50

问题


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:


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.




回答2:


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



来源:https://stackoverflow.com/questions/3612930/how-can-i-record-a-java-swing-gui-as-a-video-file-on-mac-os-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!