JSheets

Last Revision:
Version 1.2, 2006-07-11
Updated compiler options to generate 1.4 compatible bytecode.
(Full Revision History)
Build Requirements:
Xcode 2.0 or later
Runtime Requirements:
Mac OS X 10.4 or later, Java 1.4.2 or later

This sample demonstrates a mechanism for displaying document-modal sheets, a feature specific to Mac OS X applications, inside a Java application. It uses the AWT Native Interface (JAWT) to obtain a JFrame's underlying NSWindow (Cocoa) peer, and displays an NSOpenPanel or NSSavePanel using the beginSheetForDirectory:... method. Note the combination of performSelectorOnMainThread and EventQueue.invokeLater to prevent threading problems when communicating between AppKit and AWT.