CAMOBAP
CAMOBAP

Reputation: 5657

Swing - Native look-and-feel for JDialog in MacOS

Does Swing support native dialog like below: enter image description here

Or maybe exists some third party's JNI library?

Upvotes: 1

Views: 1633

Answers (2)

Alan Snyder
Alan Snyder

Reputation: 528

I am the author of a Swing look and feel called VAqua, which supports displaying windows as native sheets using an associated client library.

For example:

    JFrame owner = ...;
    JWindow w = new JWindow(owner);
    try {
        VSheet.displayAsSheet(w, null);
    } catch (UnsupportedOperationException ex) {
        ...
    }

Details here.

Upvotes: 2

trashgod
trashgod

Reputation: 205785

I haven't tried it, but Java on OS X v10.5 Update 1 says, "Document Modal Sheets can be created by setting the the apple.awt.documentModalSheet client property to Boolean.TRUE on the JRootPane of JDialog." I'm guessing something like this:

rootPanel.putClientProperty("apple.awt.documentModalSheet", Boolean.TRUE);

You might also see if Mac Widgets for Java has added anything recently.

Upvotes: 2

Related Questions