谁有fava swing out sister资源的视频资源的

&&Super Junior-M
Jah R Siam
ACEMAX-RED
Mocca Garden
hello girls
Iggy Azalea
周笔畅;白举纲
Hong Nhung
Lil Uzi Vert
Bebe Rexha本帖子已过去太久远了,不再提供回复功能。在swing界面中嵌入javaFX运行的视频 - weiyongqing - ITeye技术网站
博客分类:
javaFx2.0的出现让我迅速把注意力又转回javaFx,oracle做的不错,实现javaFX可以用钟爱的java了,看了它的实例也非常不错。
正好我在swing开发中需要嵌入视频,看javaFx的实例里就有,于是仿照这个实现一下。
其间经历了不少挫折。但最后还是搞成了。
写一下嵌入的注意事项:
1、javaFx实例中的AdvancedMedia是 extends的 javaFX里的Application这个类。Application负责掌管了视频的几个线程的启动等。
2、swing要嵌入FX组件只有一种方式就是用JFXPanel嵌入sense。这样的矛盾就不能嵌入我需要的视频了?
3、经过研究发现,可以通过AdvancedMedia继承一个applet的方式实现。
public void init() {
* Set the Nimbus look and feel
//&editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "&
* If Nimbus (introduced in Java SE 6) is not available, stay with the
* default look and feel. For details see
* /javase/tutorial/uiswing/lookandfeel/plaf.html
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(NewJApplet.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(NewJApplet.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(NewJApplet.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(NewJApplet.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//&/editor-fold&
initComponents();
jfxp = new JFXPanel();
jfxp.setPreferredSize(new Dimension(400, 300));
jPanel1.setLayout(new BorderLayout());
jPanel1.add(jfxp, BorderLayout.CENTER);
* Create and display the applet
Platform.runLater(new Runnable() {
public void run() {
createScene();
}
呵呵,这样巧妙的通过run方法里加入了sense。终于实现了。
附上我实现的源码,件附件
还有我的qq:探讨javaFX的技术问题
下载次数: 102
weiyongqing
浏览: 26741 次
来自: 北京

我要回帖

更多关于 swing 资源管理器 的文章

 

随机推荐