O'Reilly logo

Mac OS X for Java Geeks by Will Iverson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building an Application from Scratch

This section builds a Mac OS X application from scratch. It will start with the base SimpleEdit JAR file that was built in Chapter 4 and Chapter 5, and then add the necessary elements to convert it to a full Mac OS X application bundle. It will build out the directory structure shown in Figure 7-5; you might want to refer to this figure as you walk through this example.

Minimal directory structure

Figure 7-5. Minimal directory structure

Directory Layout

Create a new folder called SimpleEdit in your home directory (~) by using the Finder. Add a folder inside this new directory called Contents . This is where you’ll add the Info.plist file. Next, create a MacOS folder (no space) inside the Contents directory. Here, add a “stub” file that acts as a native launcher stub for the application.

Create a Resources folder inside Contents. This is where you will add an icns file, an icon that will be displayed in the Finder and standard file dialogs. Finally, add a Java directory to the Resources folder. This is where you’ll put the required Java libraries (JAR files).

Property List

Directly inside the Contents folder, add an Info.plist file with the contents shown back in Example 7-2.

Tip

Several of the properties are already set, including the main class and some arguments passed in to load SimpleEdit plug-ins (specifically, the SimpleEdit plug-ins developed in Chapter 9). Understanding ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required