| Log In | Not a Member? |
Contact ADC
|
|
| Previous Section | Table of Contents | Next Section |
|
This file is a library file; it is not an application. In order to make our application runnable in a convenient format, we need to build a double-clickable Macintosh application. To do so, we need to use a tool called JBindery which is part of the MRJ SDK. When JBindery launches, you will see a dialog box with the Command page showing.
The additional fields allow us to specify arguments to main (the Optional
parameters textfield), and redirect either Since we dont use these features, we can use the default values for these items.
As the above shows, our SlideShow.jar needs to be added to the classpath
so that our application classes can be found by the class loader. If SlideShow.jar
does not appear in this list, you may add it by dragging it from the Finder
into the window below the
The only item that needs to be changed is the checkbox that reads Size
boxes intrude.
Drag the file SlideShow.rsrc from the Sources (skeleton) folder in the Finder to the rectangular area below the Merge resources from checkbox. When this is successfully completed, you should see the full path of the resource file in the non-editable text field. This resource file has been pre-created for your convenience to include common Macintosh resource types such as a version resource. We have also added two resource types that you may wish to consider using in your own applications.
The first is a 'MENU' resource. We add a 'MENU'
resource with an ID of 1128 with an Apple icon as the menu,
and About SlideShow
as the sole menu item. By using this special
ID, and registering our about handler, MRJ knows to insert
this resource as the first menu item in the Apple Menu. Our menu handler
is called when this item is chosen. This also removes the default Quit
menu item from the Apple Menu, which is not preferred for finished Macintosh
applications.
It is important that the menu is created in exactly this manner, or it
will not work correctly. Additional information is provided in the Adobe
Acrobat Document About MRJ Toolkit that ships as part of the MRJ
SDK. The other main resource we added to the resource file was a
Now that we have looked at the resources and specified the resource file to be used in JBindery, we can build the application. Click on the Save Settings button and save the application in the same location as your project file using the name SlideShow. A double-clickable application will be created and should have the icons we specified. Thats it! Congratulations! You have made your first real Java-based application. Feel free to launch your application and drop some image files on it to see how it works. |
| Previous Section | Table of Contents | Next Section |