开发者

Can JVM created in Cocoa project make call backs to the Cocoa project?

I used JNI to create JVM in my Cocoa project (that has some UI compone开发者_JAVA技巧nts) and were able to make calls to JVM (another Java app) to start some jobs. Now I want the JVM to be able to call back to tell my Cocoa app the status of a job executed. Is this doable? Is there any samples that I can use as reference?


Given the current Java UI on the Mac is implemented with Cocoa, of course! Check out the Java Native Foundation framework which provides some simple Java-Cocoa bridge support (note that all the documentation links are currently broken in MobileSafari; use Opera Mini or a desktop browser). To call from Java to Cocoa you can just use JNI as you would expect. For sample code you can look at the Mac OpenJDK port - it isn't finished yet but it should give you some ideas.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜