Sheets in macOS are a way of displaying a modal dialog over a window. A sheet is document modal — it prevents the user from using the window (or other windows in a window hierarchy) until the sheet is dismissed.
VAqua supports displaying any Java window as a sheet (the window does not have to be a Dialog). The Java window must have an owner window; the sheet is attached to the owner window. The sheet is dismissed when its Java window is hidden or disposed. It is up to the application to hide or dispose the Java window. Typically, the window is hidden or disposed by an event listener associated with a button in the window, such as an accept or cancel button.
The current Swing architecture does not enable a look and feel to transparently implement
sheets. Moreover, the current Java API for document modal dialogs is seriously flawed.
Therefore, VAqua supports sheets using a new
API called VSheet.
VSheet provides basic methods for displaying a Window
or a Dialog as a sheet. VSheet also provides convenience methods for displaying
JOptionPane or a
JFileChooser as a sheet.
VSheet is a separately loadable class that uses reflection to access the sheet support in VAqua, allowing it to be used in multi-platform applications. If VAqua is not available or has not been installed, the VSheet methods provide default behaviors. For most methods, the default behavior is to fall back to displaying an ordinary (dialog) window. The most basic method throws an exception if a window cannot be displayed as a sheet, so that the application can decide what to do instead.