# Project Builder for Java (Legacy) — Apple guide, October 10, 2003 — source transcripts, page 1

[Canonical transcript page](https://www.vintageapple.net/transcripts/media/apple-software-artwork-source-2204dde56f078e59/1)

## Transcribed source material

Machine transcriptions and image descriptions; uncertain copy may be marked [illegible]. Verify against the linked originals. Historical rights remain with the original owners.

These are transcribed excerpts, not the full publications. Open the originals for remaining pages.

### Image 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/apple-software-artwork-source-2204dde56f078e59/1#scan-a4cbced77628147e8ffae2af77544b758fe1c99b718ecbb50a92ae365d566cfb)

Transcribed text:

Groups & Files
Hello_Swing
Hello_Swing.java
AboutBox.java
Preferences.java
Hello_Swing.icns
Resources
Hello_Swingstrings.properties
Products
Hello_Swing.app
Files
Classes
Bookmarks
Targets
Breakpoints
Find
Build
Run
Debug
CVS
Hello_Swing.java:1
<No selected symbol>
import java.util.Locale;
import java.util.ResourceBundle;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import javax.swing.*;
import com.apple.eawt.*;
public class Hello_Swing extends JFrame {
private Font font = new Font("serif", Font.ITALIC+Font.BOLD, 36);
protected ResourceBundle resbundle;
protected AboutBox aboutBox;
protected Preferences prefs;
private Application fApplication = new Application();
protected Action newAction, openAction, closeAction, saveAction, saveAsAction, undoAction, cutAction, copyAction, pasteAction, clearAction, selectAllAction;
static final JMenuBar mainMenuBar = new JMenuBar();
protected JMenu fileMenu, editMenu;
public Hello_Swing() {
super("");
// The ResourceBundle below contains all of the strings used in this application. ResourceBundles are useful for localizing applications. New localities can be added by adding additional properties files.
resbundle = ResourceBundle.getBundle ("Hello_Swingstrings", Locale.getDefault());
setTitle(resbundle.getString("frameConstructor"));
this.getContentPane().setLayout(null);
createActions();

Image description: A screenshot of the Project Builder IDE window showing a Groups & Files sidebar on the left and a Java source code editor displaying the Hello_Swing.java file.

Reading notes: This is a software IDE screenshot, not a historical advertisement, poster, or page; transcript covers visible UI labels and code. Lower portion of the code editor is cut off at the bottom edge of the image. Small UI text in the toolbar and sidebar may be approximate in spelling.

Languages: English

[Original Image 1](https://www.vintageapple.net/files/a31bf8387a179ba05d782c13cbfbd10b4ec5637c1b25cc5e26f7185164e3919b/project-builder-documentary.png)

### PDF page 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/apple-software-artwork-source-2204dde56f078e59/1#scan-979e73a60b9abad80d7dde960fdaffe20dd5ff909c10f11c01ba354241ad2db5)

Transcribed text:

Project Builder for Java
(Legacy)
Java > Tools
2003-10-10

Image description: A title page with a thin gray horizontal rule above a large black sans-serif title, a bold parenthetical '(Legacy)' subtitle, a blue breadcrumb 'Java > Tools', and an Apple logo with the date 2003-10-10 in the lower left on a white background.

Printed product names: Project Builder for Java

Printed dates: 2003-10-10

Languages: English

[Original PDF page 1](https://www.vintageapple.net/files/f1b84407fb57b893e51dde5101460482724a816d6f5eae5e87486cdca28743c4/project-builder-java-mirror-f1b84407fb57b893.pdf#page=1)

### PDF page 2

[Cite this scan](https://www.vintageapple.net/transcripts/media/apple-software-artwork-source-2204dde56f078e59/1#scan-aa7d8a97fa88882c11a05a042ffc5e8fbbb79b3412f2268076ab10fb56cfb1ab)

Transcribed text:

Apple Inc.
© 2003 Apple Computer, Inc.
All rights reserved.
No part of this publication may be reproduced,
stored in a retrieval system, or transmitted, in
any form or by any means, mechanical,
electronic, photocopying, recording, or
otherwise, without prior written permission of
Apple Inc., with the following exceptions: Any
person is hereby authorized to store
documentation on a single computer for
personal use only and to print copies of
documentation for personal use provided that
the documentation contains Apple’s copyright
notice.
The Apple logo is a trademark of Apple Inc.
Use of the “keyboard” Apple logo
(Option-Shift-K) for commercial purposes
without the prior written consent of Apple may
constitute trademark infringement and unfair
competition in violation of federal and state
laws.
No licenses, express or implied, are granted
with respect to any of the technology described
in this document. Apple retains all intellectual
property rights associated with the technology
described in this document. This document is
intended to assist application developers to
develop applications only for Apple-labeled
computers.
Every effort has been made to ensure that the
information in this document is accurate. Apple
is not responsible for typographical errors.
Apple Inc.
1 Infinite Loop
Cupertino, CA 95014
408-996-1010
Apple, the Apple logo, Cocoa, Mac, Mac OS,
and Objective-C are trademarks of Apple Inc.,
registered in the United States and other
countries.
Finder is a trademark of Apple Inc.
Java and all Java-based trademarks are
trademarks or registered trademarks of Sun
Microsystems, Inc. in the U.S. and other
countries.
Simultaneously published in the United States
and Canada.
Even though Apple has reviewed this document,
APPLE MAKES NO WARRANTY OR REPRESENTATION,
EITHER EXPRESS OR IMPLIED, WITH RESPECT TO
THIS DOCUMENT, ITS QUALITY, ACCURACY,
MERCHANTABILITY, OR FITNESS FOR A PARTICULAR
PURPOSE. AS A RESULT, THIS DOCUMENT IS
PROVIDED “AS IS,” AND YOU, THE READER, ARE
ASSUMING THE ENTIRE RISK AS TO ITS QUALITY
AND ACCURACY.
IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT,
INDIRECT, SPECIAL, INCIDENTAL, OR
CONSEQUENTIAL DAMAGES RESULTING FROM ANY
DEFECT OR INACCURACY IN THIS DOCUMENT, even
if advised of the possibility of such damages.
THE WARRANTY AND REMEDIES SET FORTH ABOVE
ARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORAL
OR WRITTEN, EXPRESS OR IMPLIED. No Apple
dealer, agent, or employee is authorized to make
any modification, extension, or addition to this
warranty.
Some states do not allow the exclusion or limitation
of implied warranties or liability for incidental or
consequential damages, so the above limitation or
exclusion may not apply to you. This warranty gives
you specific legal rights, and you may also have
other rights which vary from state to state.

Reading notes: The copy is a copyright and legal notice page, not an advertisement, so no headline, advertised products or prices were identified. Trademarks mentioned in the copyright text (Cocoa, Mac, Mac OS, Objective-C, Finder, Java) are not treated as advertised products. The only printed date is the copyright year 2003 in '© 2003 Apple Computer, Inc.'. Apple's address and phone number appear in the copy but are not advertised prices or product names.

Printed dates: 2003

Languages: English

[Original PDF page 2](https://www.vintageapple.net/files/f1b84407fb57b893e51dde5101460482724a816d6f5eae5e87486cdca28743c4/project-builder-java-mirror-f1b84407fb57b893.pdf#page=2)

### PDF page 3

[Cite this scan](https://www.vintageapple.net/transcripts/media/apple-software-artwork-source-2204dde56f078e59/1#scan-f4191c8af7b3860bacf440b5e6a5b6b441f60bc9d74beba304a696534d6d7494)

Transcribed text:

Contents
Introduction   Introduction to Project Builder for Java   9
Organization of This Document   9
See Also   10
Chapter 1   Application Development   11
The Tool Template   12
The Swing Application Template   13
The JNI Application Template   14
Chapter 2   Build System   17
Build Settings   17
Targets   19
Target Information Panes   19
Target Summary   19
Build Settings   20
Information Property List Entries   24
Build Styles   29
Build Phases   30
Chapter 3   Developing a Tool   33
Creating the “Hello, World” Tool   33
Creating the Clock Tool   36
Installing the Clock Tool   38
Chapter 4   Developing a Swing Application   41
Creating the “Hello, Swing” Application   41
Creating the File Chooser Demo   43
Changing an Application’s Icon   48
Chapter 5   Developing a JNI Application   51
Creating the “Hello, JNI” Application   51
JNI-Based Examples   54
Chapter 6   Debugging Applications   55
Adding Breakpoints   55
3
Legacy Document | 2003-10-10   |   © 2003 Apple Computer, Inc. All Rights Reserved.

Printed dates: 2003-10-10 · 2003

Languages: English

[Original PDF page 3](https://www.vintageapple.net/files/f1b84407fb57b893e51dde5101460482724a816d6f5eae5e87486cdca28743c4/project-builder-java-mirror-f1b84407fb57b893.pdf#page=3)

### PDF page 4

[Cite this scan](https://www.vintageapple.net/transcripts/media/apple-software-artwork-source-2204dde56f078e59/1#scan-2d1bb48d7ec2b32dcfa9812ccdf7bbd06a29abc9aa8554d256107f4eb1bb96a2)

Transcribed text:

Stepping Through Lines of Code   56
Viewing the Debug Information   58
Accessing the Contents of Objects   59
Appendix A   Build Settings Reference   61
Project Settings Reference   61
Deployment Settings Reference   61
Target Settings Reference   62
Java Compiler Settings   63
Java Application Settings   64
Document Revision History   65
Glossary   67
4   Legacy Document | 2003-10-10   |   © 2003 Apple Computer, Inc. All Rights Reserved.
CONTENTS

Printed dates: 2003-10-10 · 2003

Languages: English

[Original PDF page 4](https://www.vintageapple.net/files/f1b84407fb57b893e51dde5101460482724a816d6f5eae5e87486cdca28743c4/project-builder-java-mirror-f1b84407fb57b893.pdf#page=4)

### PDF page 5

[Cite this scan](https://www.vintageapple.net/transcripts/media/apple-software-artwork-source-2204dde56f078e59/1#scan-139387fcff7e7205fa4ea6891622c44f94f9a33039cd5f76594d2fa0520ffe47)

Transcribed text:

Figures, Tables, and Listings
Chapter 1   Application Development   11
Figure 1-1   Project Builder templates for Java development   11
Figure 1-2   The files of a Java tool project   12
Figure 1-3   Target editor for the Hammer project.   13
Figure 1-4   The files of a Java Swing application project   14
Figure 1-5   A JNI-based application project   15
Figure 1-6   Targets of JNI-based application project   16
Table 1-1   Applications types and their corresponding project templates   11
Chapter 2   Build System   17
Figure 2-1   Target Summary pane of the target editor in Project Builder   20
Figure 2-2   General Settings pane of the target editor in Project Builder   21
Figure 2-3   Installation Settings pane of the target editor in Project Builder   21
Figure 2-4   Search Paths pane of the target editor in Project Builder   22
Figure 2-5   Java Compiler Settings pane of the target editor in Project Builder   23
Figure 2-6   Java Archive Settings pane of the target editor in Project Builder   24
Figure 2-7   Basic Information pane of the target editor in Project Builder   25
Figure 2-8   Display Information pane of the target editor in Project Builder   26
Figure 2-9   Application Icon pane of the target editor in Project Builder   27
Figure 2-10   Cocoa Java–Specific pane of the target editor in Project Builder   27
Figure 2-11   Pure Java–Specific pane of the target editor in Project Builder   28
Figure 2-12   Build style definition   30
Figure 2-13   Build-setting display script   31
Figure 2-14   Output of a build-setting display script   31
Table 2-1   Project build settings   17
Table 2-2   Deployment build settings   18
Table 2-3   Target build settings   18
Table 2-4   Java compiler build settings   18
Table 2-5   Java application build setting   18
Table 2-6   Elements of the Target Summary pane   20
Table 2-7   Elements of the General Settings pane   21
Table 2-8   Elements of the Installation Settings pane   22
Table 2-9   Elements of the Search Paths pane   22
Table 2-10   Elements of the Java Compiler Settings pane   23
Table 2-11   Elements of the Java Archive Settings pane   24
Table 2-12   Elements of the Basic Information pane   25
Table 2-13   Elements of the Display Information pane   26
Table 2-14   Elements of the Application Icon pane   27
Table 2-15   Elements of the Cocoa Java–Specific pane   28
Table 2-16   Elements of the Pure Java–Specific pane   28
5
Legacy Document | 2003-10-10   |   © 2003 Apple Computer, Inc. All Rights Reserved.

Reading notes: Header 'Figures, Tables, and Listings' is a list heading rather than a primary headline; headline set to null. Hammer appears only as a project name in a figure caption.

Printed product names: Project Builder · Hammer

Printed dates: 2003-10-10 · 2003

Languages: English

[Original PDF page 5](https://www.vintageapple.net/files/f1b84407fb57b893e51dde5101460482724a816d6f5eae5e87486cdca28743c4/project-builder-java-mirror-f1b84407fb57b893.pdf#page=5)

### PDF page 6

[Cite this scan](https://www.vintageapple.net/transcripts/media/apple-software-artwork-source-2204dde56f078e59/1#scan-bb150c407f509f9076180027948aaeec640ed1355c080d3342a003df4b7666d2)

Transcribed text:

Chapter 3   Developing a Tool   33
Figure 3-1   The Hello project in Project Builder   35
Figure 3-2   Project Builder’s Run pane showing Hello’s console output   35
Figure 3-3   Arguments pane of the executable editor in Project Builder   37
Figure 3-4   Output of Clock tool displayed in Project Builder   37
Figure 3-5   Expert View pane of the target editor in Project Builder   38
Figure 3-6   Clock distribution directory in   /tmp   39
Figure 3-7   Clock target directory   39
Figure 3-8   Output of Clock viewed through Console   39
Chapter 4   Developing a Swing Application   41
Figure 4-1   The Hello_Swing project in Project Builder’s window   43
Figure 4-2   Hello_Swing application in action   43
Figure 4-3   Delete References dialog of Project Builder   44
Figure 4-4   Adding source files to a project in Project Builder   45
Figure 4-5   FileChooser in action   47
Figure 4-6   Open dialog displayed by FileChooserDemo   47
Chapter 5   Developing a JNI Application   51
Figure 5-1   The Leverage project in the Project Builder window   52
Figure 5-2   The build folder of the Leverage project after building the application   54
Listing 5-1   Leveragejnilib.c   source file in the Leverage project   53
Listing 5-2   JNIWrapper.java   source file in the Leverage project   53
Chapter 6   Debugging Applications   55
Figure 6-1   Breakpoint in   Debug.java   file of Debug project   56
Figure 6-2   Debugging an application—stopping   57
Figure 6-3   Debugging an application—stepping over   57
Figure 6-4   Debugging an application—stepping into a method   58
Figure 6-5   Debugging an application—viewing variable information   59
Figure 6-6   Debugging an application—viewing an object’s contents   60
Listing 6-1   Debug.java   file of Debug project   55
Listing 6-2   Person.java   file   59
Listing 6-3   Console output after executing Print Description to Console command on a Person
object   60
Appendix A   Build Settings Reference   61
Table A-1   Project build settings   61
Table A-2   Deployment build settings   61
Table A-3   Target build settings   62
6   Legacy Document | 2003-10-10   |   © 2003 Apple Computer, Inc. All Rights Reserved.
FIGURES, TABLES, AND LISTINGS

Reading notes: Page header text and some table or figure entries contain typographic punctuation that may vary in reading order

Printed product names: Project Builder · Hello_Swing · Leverage · Debug.java · Person.java · Leveragejnilib.c · JNIWrapper.java · Clock · FileChooserDemo

Printed dates: 2003-10-10 · 2003

Languages: English

[Original PDF page 6](https://www.vintageapple.net/files/f1b84407fb57b893e51dde5101460482724a816d6f5eae5e87486cdca28743c4/project-builder-java-mirror-f1b84407fb57b893.pdf#page=6)

### PDF page 7

[Cite this scan](https://www.vintageapple.net/transcripts/media/apple-software-artwork-source-2204dde56f078e59/1#scan-035134f0c00a51a9c87edfd26bfd96447b488073fc79c5119fc48e70e57be8f9)

Transcribed text:

Table A-4   Java compiler build settings   63
Table A-5   Java application build settings   64
7
Legacy Document | 2003-10-10   |   © 2003 Apple Computer, Inc. All Rights Reserved.
FIGURES, TABLES, AND LISTINGS

Reading notes: Source text is a table of contents fragment with page numbers; no advertised products or prices present.

Printed dates: 2003-10-10 · 2003

Languages: English

[Original PDF page 7](https://www.vintageapple.net/files/f1b84407fb57b893e51dde5101460482724a816d6f5eae5e87486cdca28743c4/project-builder-java-mirror-f1b84407fb57b893.pdf#page=7)

### PDF page 8

[Cite this scan](https://www.vintageapple.net/transcripts/media/apple-software-artwork-source-2204dde56f078e59/1#scan-eaccdb19094061595ae7bc0d74dcba104c1aa62fafa2b8aee2ad4ef887c9ad08)

Transcribed text:

FIGURES, TABLES, AND LISTINGS

8

Legacy Document | 2003-10-10 | © 2003 Apple Computer, Inc. All Rights Reserved.

Image description: A mostly blank white page with a blue section heading at the top left, a page number at the bottom left, and a red and black legal footer line at the bottom.

Reading notes: The page appears to be a document page rather than an advertisement or poster; no advertised products or prices are present. The main body of the page is blank apart from the heading and footer.

Printed dates: 2003-10-10 · 2003

Languages: English

[Original PDF page 8](https://www.vintageapple.net/files/f1b84407fb57b893e51dde5101460482724a816d6f5eae5e87486cdca28743c4/project-builder-java-mirror-f1b84407fb57b893.pdf#page=8)

### PDF page 9

[Cite this scan](https://www.vintageapple.net/transcripts/media/apple-software-artwork-source-2204dde56f078e59/1#scan-15c3aad1f781bfc3b96dbd0ca96de7f825c783f5f73e8e77bcb115af0e482de7)

Transcribed text:

Important:   The information in this document is obsolete and should not be used for new development.
This document addresses Java development in Mac OS X using Project Builder. Project Builder is part of
Apple’s integrated development environment.
Important:   To run the examples described in this document, you must have installed Java 1.4.1 and the
December 2002 (or later) Developer Tools package.
You should read this document if you are a Java developer who is interested in developing applications for
Mac OS X or want to port an existing application into Mac OS X.
Organization of This Document
This document has the following chapters and appendixes:
■   “Application Development” (page 11) introduces Java development using Project Builder. The chapter
explains each of the Java-based templates, which give you a head start when developing a project.
■   “Build System” (page 17) addresses the Project Builder build system. It describes build settings, build
targets, and build styles.
■   “Developing a Tool” (page 33) explains how to use the Java Tool template to develop a text-based Java
application. This a good place to start if you’re new to Java development in Mac OS X.
■   “Developing a Swing Application” (page 41) explains how to use the Java Swing Application template
to develop a graphical user interface–based application.
■   “Developing a JNI Application” (page 51) provides an overview of the Java JNI Application template,
which you can use to develop Java applications that need to interact with native code.
■   “Debugging Applications” (page 55) focuses on Project Builder’s debugging facilities.
■   “Build Settings Reference” (page 61) describes the build settings that you may need to configure in Java
applications.
Following the appendixes are a document revision history, and a glossary.
Organization of This Document   9
Legacy Document | 2003-10-10   |   © 2003 Apple Computer, Inc. All Rights Reserved.
INTRODUCTION
Introduction to Project Builder for Java

Reading notes: Heading "Introduction to Project Builder for Java" appears after the chapter list, so reading order may be uncertain.

Printed product names: Project Builder · Java 1.4.1 · Developer Tools

Printed dates: December 2002 · 2003-10-10 · 2003

Languages: English

[Original PDF page 9](https://www.vintageapple.net/files/f1b84407fb57b893e51dde5101460482724a816d6f5eae5e87486cdca28743c4/project-builder-java-mirror-f1b84407fb57b893.pdf#page=9)

### PDF page 10

[Cite this scan](https://www.vintageapple.net/transcripts/media/apple-software-artwork-source-2204dde56f078e59/1#scan-97154ee486f2bd38cc2f2b883cf2057562fb949de7c5d44cebe2a358f56279b4)

Transcribed text:

See Also
There are source files and Project Builder projects in the companion files of this document. They are located
in   /Developer/ADC   Reference
Library/documentation/Java/Conceptual/Project_Builder_for_Java/Project_Builder_for_Java_companion.zip ;
that directory is called   companion   in the remainder of this document. You can also download the companion
files from http://developer.apple.com/documentation/Java/index.html.
For general information about Project Builder, see Project Builder Help. For information on specialized Project
Builder customization, see   Customizing Project Builder , at http://developer.apple.com/documentation/Devel-
operTools/index.html.
10   See Also
Legacy Document | 2003-10-10   |   © 2003 Apple Computer, Inc. All Rights Reserved.
INTRODUCTION
Introduction to Project Builder for Java

Reading notes: Running page header and section label ('See Also', 'INTRODUCTION') appear alongside body text; primary heading is taken as 'Introduction to Project Builder for Java'.

Printed product names: Project Builder

Printed dates: 2003-10-10 · 2003

Languages: English

[Original PDF page 10](https://www.vintageapple.net/files/f1b84407fb57b893e51dde5101460482724a816d6f5eae5e87486cdca28743c4/project-builder-java-mirror-f1b84407fb57b893.pdf#page=10)

### PDF page 11

[Cite this scan](https://www.vintageapple.net/transcripts/media/apple-software-artwork-source-2204dde56f078e59/1#scan-626b4ba0062b0b8f622571c958f01ea0deae5b31e035dd1b253ff402778e6728)

CHAPTER 1 Application Development

Transcribed text:

This chapter introduces the development of Java applications using Project Builder. Project Builder provides
a development environment in which you can develop, build, and deploy Java applications. In addition,
Project Builder has a project template that facilitates the development of applications that use the native
Mac OS X environment, that is, applications that have both Java code as well as C or Objective-C code.
Project Builder templates are prebuilt projects that give you a head start in the development of an application.
Figure 1-1 shows the New Project pane of the Project Builder Assistant, listing the Java project templates
you can use to develop applications. When you want to develop a Swing-based application, for example,
you can start with the Swing application template, which provides a fully configured application that follows
Apple’s guidelines for GUI (graphical user interface) applications. That template is also useful if you’re new
to Java and Swing and want to see the inner workings of a working application.
Figure 1-1   Project Builder templates for Java development
Table 1-1 shows the type of Java applications you can develop with Project Builder and their corresponding
project templates.
Table 1-1   Applications types and their corresponding project templates
Template name Application type
Java Tool Text-based application
Java Swing Applet Swing applet
11
Legacy Document | 2003-10-10   |   © 2003 Apple Computer, Inc. All Rights Reserved.
CHAPTER 1
Application Development

Reading notes: Running header and footer text appear mixed into the body copy, so reading order may be uncertain.

Printed product names: Project Builder · Project Builder Assistant · Java Tool · Java Swing Applet

Printed dates: 2003-10-10 · 2003

Languages: English

[Original PDF page 11](https://www.vintageapple.net/files/f1b84407fb57b893e51dde5101460482724a816d6f5eae5e87486cdca28743c4/project-builder-java-mirror-f1b84407fb57b893.pdf#page=11)

[Next transcribed scans](https://www.vintageapple.net/transcripts/media/apple-software-artwork-source-2204dde56f078e59/2.md)
