2: Java App look and Feel of MacOS with Netbeans

Often there is the need that it has to look like macOS and not like Java. As Xojo Developers we know how important it is: looking native. Java has for MacOS a few goodies. I want to show how to build a Form with a menu in Netbeans. This Tutorial is made for the Developers which need to deliver on MacOS! For Windows you would have to build up also a Look and Feel Setting and an OS-Detector.

like in the tutorial before which you will find here: 1: Java Development on Netbeans Platform
we are building an Application with Ant and inserting a Frame Window. In this Window we are inserting a menu like you can see here:

and in the main method of this Page we write as the first line: System.setProperty(“apple.laf.useScreenMenuBar”, “true”);

after we edit the look and feel setting and change the word Nimbus to the word System like this here:

Starting the App with the green arrow results in:

and the program looks like MacOS App. Have fun.

4 Likes

wow that is so simple, thanks, off to give it a test.

Great. But this is not the system font macOS uses today.

2 Likes

The next Look and Feel Tutorium I will do with actual standard Font Settings on my MAC and with the right Settings to have the actual Systems Fonts in Look and Feel. Thank you for marking this Error.