Apple's Java, which is on version 6 on my machine, has a class com.apple.eawt.CocoaComponent
for connecting AWT/Swing apps to Cocoa components. An example use: displaying the UI of an AudioUnit (which is a Cocoa view) in a Java app. I'd like to use Java 7, but I can't find this class in it. Anyone know if it's there, somewhere? Or if there is an alternative?
The com.apple.eawt
classes are indeed included with the Oracle JDKs from 7u4 up through the latest (as of 10/30/2012) 7u9. For some example usage, see Fullscreen feature for Java Apps on OSX Lion or FullScreen Swing Components Fail to Receive Keyboard Input on Java 7 on Mac OS X Mountain Lion
One issue is that they do not seem to be building javadoc for those classes at the moment, so looking up the latest APIs is fairly difficult. I've resorted to searching for the .java files online. You may also have some luck with the older API reference on developer.apple.com, though this does not include newer classes like FullScreenUtilities.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With