OS Integration API provides specific code to handle the integration of your application on MacOS X system. Indeed, on Apple's computers, UI requires:

  • a unique menu bar
  • actions for Close, About and Preferences are attached to the Apple menu
  • a Dock icon

In addition, recent releases of OS X provide a way to display application main frame on a full screen mode.

Plealog's Generic Java Swing Application Framework (jGAF) provides all the code to handle that for you. For instance, the call of the following code snippet is enough to start your UI whatever the operating systems:

1
2
3
4
5
6
7
8
public static void main(String[] args) {
  // This has to be done at the very beginning, i.e. first method call within
  // main().
  EZGenericApplication.initialize("TutorialTwoUIStarter");
 
  // Start the application
  EZGenericApplication.startApplication(args);
}

 

However, if GAF detects that your application runs on MacOS X, then it automatically executes dedicated code for OS X integration. The magic Java code line is #4 that does the work of OS integration for you.