Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Running external apps in a JFrame?  RSS feed

 
Bryan Scarbrough
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a project for work and need to know if it is possible to run external applications, such as Windows Media Player, etc. in a JFrame or JInternalFrame? Also, if this is possible will it treat the frame area as "Full Screen" when the media player is placed in full screen mode?

Right now just trying to see if this is possible before I spend a great deal of time researching it.
 
Nick Meverden
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swing does support Full Screen Exclusive Mode, but wrapping applications will require JNI code to interface with the current Window Manager.
 
Bryan Scarbrough
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nick, Thanks for the quick reply! I figured Swing would not support it natively and I think I have found a way around my problem anyway, but in the meantime...

How difficult is it to learn JNI (for someone who has not programmed Java in a while)? Any good tutorials or books?

Thanks again!
 
Nick Meverden
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bryan,

check out http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/jniTOC.html

But JNI is a bear, and garrentied you will not have fun. Plus you will lose platform independence as your code will be targeted towards one OS, using one Window Manager.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure if this is helpful - i.e. if you need to run external apps other than Windows Media Player - but if you just need to play various movie formats - you can use JMF.

If it is the case that you need to embed all kinds of other windows applications in your app - you may want to look at using SWT rather than Swing - SWT provides some ActiveX bindings that may help you further than direct JNI.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!