Introduction.............................................................................................................................
The JBuilder Companion.................................................................................................
Style and Intended Audience...........................................................................................
Content.......................................................................................................................
The Purpose of the Book.............................................................................................
JBuilder Overview...........................................................................................................
The Myth of the Proprietary Format.............................................................................
Project Management...................................................................................................
A Word about the Editions of JBuilder.........................................................................
About Java......................................................................................................................
The Changing Java Specification..................................................................................
Java Language Lawyers...............................................................................................
This Book and the Java Language................................................................................
JBuilder and Swing......................................................................................................
What Do I Think of Java?............................................................................................
What do I think of Bill and Linus?................................................................................
Contacting Us, The Source Code on the CD....................................................................
I Am Not a Lawyer.........................................................................................................
My – or is it Our -- Writing Style.....................................................................................
1.7 Summary...................................................................................................................
Setup and Configuration......................................................................................................
Overview........................................................................................................................
Install Overview..............................................................................................................
Hardware Requirements..................................................................................................
Installing the JDK............................................................................................................
The JBuilder Install......................................................................................................
Downloading and Installing JBuilder Personal Edition....................................................
Notes on Installing JBuilder for Windows.....................................................................
Notes on Installing JBuilder on Linux............................................................................
The Alternate Install from a Zip File.............................................................................
Checking to Make Sure Basic Applets and Applications Run...........................................
Configuring JBuilder from the Command Line...................................................................
Getting Memory Set up right............................................................................................
Problems with font.properties..........................................................................................
Using Ant........................................................................................................................
CodeBox........................................................................................................................
Summary.........................................................................................................................
Creating a Default Application or Applet..............................................................................
Overview....................................................................................................................
The Steps for Creating a New Project.........................................................................
Optional Step Which Will Facilitate Javadoc Documentation........................................
Creating a New Application.........................................................................................
Creating a New Applet................................................................................................
Viewing Your Applet...................................................................................................
Viewing the Applet Through a Browser........................................................................
Summary.....................................................................................................................
The
AppBrowser: The Core of the IDE...................................................................................
Defining our Terms: The IDE and AppBrowser................................................................
The AppBrowser........................................................................................................
Exploring a Simple Project...............................................................................................
The Message Pane..........................................................................................................
The File View tabs..........................................................................................................
Automation: Creating a Class...........................................................................................
A Glancing Introduction to CodeInsight........................................................................
Summary.........................................................................................................................
Chapter 05..............................................................................................................................
JBuilder Product Overview..................................................................................................
The File Menu.................................................................................................................
The Object Gallery - Personal, SE and Enterprise Versions..........................................
The General Page........................................................................................................
The Project Page.........................................................................................................
The Web Page............................................................................................................
The XML Page...........................................................................................................
The CORBA Page......................................................................................................
The Build Page............................................................................................................
The Enterprise Page....................................................................................................
The "Test" Page...........................................................................................................
The Search Menu............................................................................................................
Find in Path.................................................................................................................
Incremental Search......................................................................................................
Go To Line.................................................................................................................
Find Classes................................................................................................................
The Project Menu...........................................................................................................
Customizing the JBuilder Environment..............................................................................
Tabs and Carriage Returns..........................................................................................
The Run Menu................................................................................................................
The Team Menu..............................................................................................................
The Wizards Menu..........................................................................................................
The Tools Menu..............................................................................................................
Adding a Third Party Tool to the JBuilder Menu System...............................................
The Window Menu.........................................................................................................
The Help Menu...............................................................................................................
The Open Tools API.......................................................................................................
Summary.........................................................................................................................
The UI
Designer..............................................................................................................
Overview........................................................................................................................
A Theory of Interface Design...........................................................................................
UI Designer Basics..........................................................................................................
Dropping Components on the UI designer........................................................................
Viewing the Source JBuilder Generates........................................................................
The Constructor for Frame1........................................................................................
Understanding jbInit....................................................................................................
More on Editing UI Code by Hand..............................................................................
Coming to Terms with processWindowEvent...............................................................
Visual Programming Tricks and Techniques......................................................................
Multi-Selecting Components........................................................................................
Deleting Components..................................................................................................
The Structure Pane Rules!...........................................................................................
The Inspector..................................................................................................................
Creating a Simple Event Handler..................................................................................
Using JTabbedPane.........................................................................................................
Setting your ClassPath Inside the IDE..............................................................................
Summary.........................................................................................................................
Using the
Editor.......................................................................................................................
Key Mapping..................................................................................................................
JBuilder and Macros.......................................................................................................
Code Templates..............................................................................................................
Setting up Tabs...............................................................................................................
Setting up Carriage Returns and Line Feeds.....................................................................
Error Insight................................................................................................................
Letting JBuilder Write Your try..catch Blocks...............................................................
Letting JBuilder Write Your Import Statements................................................................
More on Import Statements.........................................................................................
Optimizing Imports......................................................................................................
CodeInsight.....................................................................................................................
MemberInsight............................................................................................................
ClassInsight.................................................................................................................
ParameterInsight..........................................................................................................
Find Definition.............................................................................................................
Find References..........................................................................................................
Integration with the Structure Pane...................................................................................
Resource Strings.............................................................................................................
Override Methods...........................................................................................................
Implementing Interfaces...................................................................................................
Integration with Emacs or other Editors............................................................................
Using Bookmarks............................................................................................................
Access to Javadoc..........................................................................................................
Viewing Javadoc with the F1 Key................................................................................
Viewing Javadoc with the File View Tabs....................................................................
JavaDoc......................................................................................................................
Viewing Javadoc by Unzipping a Jar File......................................................................
Finding Errors After a Compile....................................................................................
Summary.....................................................................................................................
Java Basics:
Classes and Methods...........................................................................................
The Governing Analogy of the Next Three Chapters.........................................................
Understanding Java Classes.............................................................................................
Basic Class Syntax..........................................................................................................
The Scope of a Class: Default vs. Public..........................................................................
Nested Class: Not Covered in this Chapter..................................................................
Creating and Destroying Classes......................................................................................
Declaring Methods in a Class...........................................................................................
Working with Strings...................................................................................................
Declaring the Type of a Method...................................................................................
Using a Class in an Application........................................................................................
Constructors...................................................................................................................
Public Classes, Your First Package..................................................................................
Inheritance..................................................................................................................
Summary.........................................................................................................................
Java Basics: Types..................................................................................................................
The Basic Java Types......................................................................................................
A Class that Uses All the Types.......................................................................................
Declaring the Simple Types..............................................................................................
Initializing the Simple Types.............................................................................................
Thinking about booleans..................................................................................................
Thinking about chars........................................................................................................
Working with bytes.........................................................................................................
Working with shorts, ints and longs..................................................................................
What Should I Use: A byte, short, int or long?..................................................................
Working with floats and doubles......................................................................................
A Program to Test the MyTypes Class............................................................................
Working with Menus.......................................................................................................
The Code in the CallMyTypes Application.......................................................................
Summary.........................................................................................................................
Statements,
Expressions and Keywords...................................................................................
Statements..........................................................................................................................
Examples of Statements...................................................................................................
Compound Statements....................................................................................................
Expressions.....................................................................................................................
Keywords.......................................................................................................................
Assertions...................................................................................................................
Summary.............................................................................................................................
Looping,
Operators and Currency...........................................................................................
Loops.............................................................................................................................
for Loops........................................................................................................................
while Loops....................................................................................................................
Understanding Math Operators........................................................................................
Example of Using the Math Operators.............................................................................
Multiplication Operators and Integers...........................................................................
Floating Point Operations and Accuracy..........................................................................
Floating Point Types and Money: BigDecimal...............................................................
Review of Promoting and Converting Types.....................................................................
Assignment Operators.....................................................................................................
Summary.........................................................................................................................
Layout
Managers....................................................................................................................
Layout Theory.................................................................................................................
Some Theory on Containers........................................................................................
GridBagLayout vs the World.......................................................................................
A Layout is Just a Class...............................................................................................
Using Borland Classes in Your Program.......................................................................
BorderLayout..................................................................................................................
GridLayout......................................................................................................................
FlowLayout.................................................................................................................
Basic Dialog Look with Flow Layout...............................................................................
Basic Dialog Look with Vertical FlowLayout...............................................................
Boxes, more Boxes and Box Layouts..............................................................................
Using the Box Container Component...........................................................................
BoxLayout2....................................................................................................................
Using the Box Class with BoxLayout2.............................................................................
BoxLayout Dialog Buttons on Right.................................................................................
Summary.........................................................................................................................
More Layouts
and Menus........................................................................................................
Null or XYLayout...........................................................................................................
GridBagLayout................................................................................................................
CardLayout.....................................................................................................................
SE and Enterprise Level Layout Managers...................................................................
The Menu Designer.........................................................................................................
Summary.........................................................................................................................
Event
Handling........................................................................................................................
Basic Event Handling.......................................................................................................
How Events Get Called...............................................................................................
Anonymous Adapters..................................................................................................
Anonymous Adapters vs Standard Adapters................................................................
The ActionEvent Class................................................................................................
Using other Standard Events........................................................................................
Customizing the JBuilder Event Handling Mechanism....................................................
Listener Interfaces and Adapter Classes...........................................................................
KeyListener, MouseListener, MouseWheelListener and MouseMotionListener.............
Understanding the MouseKey Program........................................................................
Key Listener Interface.................................................................................................
Creating the KeyPanel and MousePanel.......................................................................
Registering a Listener...................................................................................................
Using the KeyPanel and MousePanel...........................................................................
Virtual Desktops: JDesktop, JInternalFrame, and MDI Programs.....................................
Mouse Adapters.........................................................................................................
Summary.........................................................................................................................
Firing
Events...........................................................................................................................
A Send Event Example Program..................................................................................
The Method that Sends the Message...........................................................................
Sending Custom Messages..............................................................................................
Understanding the Poet Custom Event Class................................................................
Firing a Custom Event in a Thread...............................................................................
Using Threads to Create a Timer.................................................................................
Architectural Traits of the Poet Event...........................................................................
Listening for Custom Events.........................................................................................
Summary.........................................................................................................................
Radio
Buttons and Check Boxes.............................................................................................
Creating an Applications that Uses Radio Buttons and Check Boxes................................
Adding In Menus.........................................................................................................
Adding Events.............................................................................................................
Handling Check Box Events........................................................................................
Event Handlers for the Menu Items..............................................................................
Radio Buttons and Enumerated Types..............................................................................
Type Safe and Unlikely to Be Abused..........................................................................
Making Your Enumerated Type Public.........................................................................
The Source for the RadioButtonApplet Example..........................................................
The Event Handlers.........................................................................................................
Summary.........................................................................................................................
Visual
Design and Reuse..........................................................................................................
Using the JSlider Component in an Applet........................................................................
Creating the Interface..................................................................................................
Adding Events.............................................................................................................
Hooking Up Multiple Controls to the Same Event........................................................
Adding MyColorSlider to the Main Window of the Applet...........................................
Testing the Applet.......................................................................................................
Building Your Applet out of Multiple Components........................................................
Interlude: Applets, JApplets and Swing........................................................................
List Boxes.......................................................................................................................
Building the List Box Sample.......................................................................................
Adding Objects to a JList............................................................................................
Adding Graphics to a JList...............................................................................................
Cell Renderers: Creating the Components to be Displayed in a JList.............................
Summary.........................................................................................................................
The Art of
the Button...............................................................................................................
Working with Buttons..................................................................................................
HTML, Mnemonics and Responding to the Alt Key.....................................................
Bitmaps in Buttons.......................................................................................................
Setting an IconImage for your Application....................................................................
Using GridBagLayout to Push the Button Envelope..........................................................
Configuring Your Bitmap Buttons.................................................................................
Turning a JPanel into a Button......................................................................................
Event Handling in a JPanel Button................................................................................
Painting the JPanel Button............................................................................................
Using Your Own JavaBeans in Your Program..............................................................
Summary.........................................................................................................................
Creating
Dialogs......................................................................................................................
Starting the DialogDemo Application................................................................................
Using the JBuilder About Dialog..................................................................................
Using JOptionPane to Create Input Dialogs..................................................................
Input and Message Dialogs..........................................................................................
Using JOptionPane to Display a Confirmation Dialog....................................................
Code Insight Rides in on a White Horse.......................................................................
A Fancy Message Dialog.............................................................................................
Custom JOptionPane Dialogs......................................................................................
Creating a Custom Dialog............................................................................................
Summary.........................................................................................................................
Composing
Java......................................................................................................................
Cold Mountain Code.......................................................................................................
Topics Covered in this Chapter........................................................................................
Dedication.......................................................................................................................
Simplify, Simplify, Simplify...............................................................................................
Java to the Rescue.......................................................................................................
Naming Conventions.......................................................................................................
Abstract Language vs. Specific Language.....................................................................
Using JBuilder to Soften the Blow of Brute Force Programming....................................
Finding a Remedy........................................................................................................
Epilogue......................................................................................................................
Variable Names and Access Methods.........................................................................
Method Arguments: Bad, Average, and Good Naming Conventions.................................
Why Do Programmers Use Bad Naming Conventions?................................................
Is It Ever Ok to Use Imprecise Variable Names?.........................................................
Summary.........................................................................................................................
Comments and
Javadoc...........................................................................................................
Commenting Your Code..................................................................................................
Man versus the Machine..................................................................................................
The Three Levels of Completeness when Commenting Code............................................
Code without Comments.............................................................................................
Commenting each Object and Method.........................................................................
Fully Commenting your Code......................................................................................
The Technology Behind the Theory..................................................................................
JBuilder and Comments...............................................................................................
Using Javadoc.................................................................................................................
Doclets.......................................................................................................................
The Javadoc Wizard........................................................................................................
Generating Documentation...........................................................................................
Understanding the Javadoc Files..................................................................................
Package Level Comments...........................................................................................
Overview Comments...................................................................................................
Javadoc Tags and Syntax Highlighting..........................................................................
Javadoc Options.........................................................................................................
Viewing the Javadoc Files in a Browser...........................................................................
Working with Javadoc from the Command Line...........................................................
Summary.........................................................................................................................
Modularity:
Divide and Conquer..............................................................................................
The Aesthetics of Programming........................................................................................
The Divide and Conquer Aesthetic...................................................................................
Usable, Extensible and Abstract.......................................................................................
Objects and Scope: Hide as Much as Possible.................................................................
Performance Issues.........................................................................................................
How Much Complexity is Enough Complexity?............................................................
Java the Exemplar to the Rescue..................................................................................
Planning Your Code........................................................................................................
Object Modularity and Reuse......................................................................................
Discovering the Objects in a Problem...........................................................................
Imagining the Solution..................................................................................................
Creating the Public Methods for a Class.......................................................................
Composing Methods...................................................................................................
Never Copy Code......................................................................................................
Isolate Discreet Tasks.................................................................................................
About Long Methods..................................................................................................
Use Packages for Major Subtasks...............................................................................
Event Madness................................................................................................................
The FileRename program.............................................................................................
Summary.........................................................................................................................
Building
Simple Applications....................................................................................................
Overview........................................................................................................................
What are JPR and JPX Files?..........................................................................................
Simple Applications without Packages.............................................................................
Exploring Your New Project.......................................................................................
Running Your Code: Setting the Main Class for Your Project.......................................
The "Project for Existing Code" Wizard.......................................................................
Moving a Project.........................................................................................................
Creating a Simple Project with no Packages.....................................................................
Creating a JBuilder Type Project with no Packages......................................................
Compiling from the Command Line..................................................................................
Placing Multiple Projects in One Directory.......................................................................
Running the Simpler JDK Demos from JBuilder................................................................
Running the Animator Demo........................................................................................
Running the ArcTest Applet.........................................................................................
Running Applications from the JDK.................................................................................
Making Sense of the Options...........................................................................................
Summary.........................................................................................................................
The
Structure of a Default JBuilder Project...........................................................................
Default JBuilder Projects.................................................................................................
Creating a Default Application.....................................................................................
Locating Your Files on the Harddrive...............................................................................
Default Paths for Files..................................................................................................
Changing the Default Location for Your Projects..........................................................
Moving Projects, Notes on Projects............................................................................
Thinking about JPX and JPR Files...................................................................................
Compiling Default Project from the Command Line..........................................................
Configuration Issues........................................................................................................
How do I save a File...................................................................................................
JBuilder and Linefeeds.................................................................................................
How do I Turn Off the Sound Effects?.........................................................................
How Do I Tell JBuilder the Main File For My Project..................................................
Applet and Application Hybrids...................................................................................
What about JDK Switching?........................................................................................
Summary.........................................................................................................................
Creating
Complex Projects......................................................................................................
Complex Projects............................................................................................................
Adding Deleting and Refreshing Project Files...................................................................
JBuilder and Packages.....................................................................................................
Automatically Importing Packages in JBuilder...............................................................
Understanding Packages..............................................................................................
Introducing CodeBox..................................................................................................
Creating Complex Projects..............................................................................................
Examining StringTest01...............................................................................................
StringTest01 Events.....................................................................................................
More Complex Paths......................................................................................................
ClassPaths in the Timer Application.............................................................................
Paths Outside Your Project: Part II..................................................................................
Creating Classes in Directories OutSide your Current Project.......................................
Summary.........................................................................................................................
Team
Development.................................................................................................................
Why Use CVS................................................................................................................
Terminology................................................................................................................
Adding a Project and Files to CVS..................................................................................
Adding An Application................................................................................................
The Status Browser.....................................................................................................
The Commit Browser..................................................................................................
More on Using the Status Browser..................................................................................
Removing a File...............................................................................................................
Version Labels................................................................................................................
Checking Out and Updating a Project..............................................................................
Resolving Conflicts..........................................................................................................
Using CVS with JBuilder Personal and SE Editions..........................................................
Basic Information and Resources.................................................................................
Front End Tools..........................................................................................................
Working with CVS from the Command Line....................................................................
Initializing a CVS repository for PSERVER..................................................................
Logging into a CVS PServer........................................................................................
Creating a CVS Project...............................................................................................
Checking out a CVS Project.......................................................................................
Committing your work.................................................................................................
Getting Updates..........................................................................................................
Adding Files................................................................................................................
Removing Files............................................................................................................
Getting the Status of a File...........................................................................................
Making a file Binary after its been Checked In..............................................................
Retrieving a Tagged Version Label...............................................................................
Summary.........................................................................................................................
Working with
Jar Files.............................................................................................................
Understanding Jar Files....................................................................................................
Why Use Packages?.......................................................................................................
Jar Files and ClassPaths..............................................................................................
Creating and Using Jar Files.............................................................................................
Setting up the Test Program.........................................................................................
Creating the CodeBox Jar File.........................................................................................
Building CodeBoxSimple.jar from the command line.....................................................
The Manifest File.........................................................................................................
Testing Your Jar File...................................................................................................
Setting Your ClassPath: JBuilder Library Files..................................................................
Using Your Jar File In the JBuilder IDE............................................................................
Libraries that Contain only Class Files..........................................................................
Compiling TimeIt from the Command Line...................................................................
Summary.........................................................................................................................
Deploying Applets, Applications and Java Executables.....................................................
Creating a Resource........................................................................................................
Creating a Button in Paint Shop Pro:............................................................................
Creating a Button in the GIMP.....................................................................................
Creating the Application..................................................................................................
Integrating a Resource Into Your Application...............................................................
Configuring the Button.................................................................................................
Run the application, and it will look something like
Figure 3..........................................
Deploying the Application............................................................................................
Creating the Jar File.....................................................................................................
Viewing the Archive You have Created........................................................................
Creating an Executable................................................................................................
Understanding JBuilder Executables.............................................................................
Creating a Jar File from the Command Line..................................................................
Creating an Archive with Ant.......................................................................................
Placing an Applet in a Jar File......................................................................................
Creating the Jar File.....................................................................................................
Using the Archive in a Browser....................................................................................
The ExitApplet............................................................................................................
Web Start Applications...............................................................................................
Road Blocks...............................................................................................................
Summary.....................................................................................................................
The Debugger.........................................................................................................................
Tough Guys Don't Use Debuggers...............................................................................
Simple Debugging Techniques..........................................................................................
Writing to Standard Out..............................................................................................
Writing to Log Files.....................................................................................................
Logging Levels............................................................................................................
Assertions.......................................................................................................................
The JBuilder Debugger....................................................................................................
Turning On the Debbugger...........................................................................................
Finding Your Place in the Debugger.............................................................................
Controlling the Debugger.............................................................................................
The Debugger Views...................................................................................................
The Message View......................................................................................................
The Watch View.........................................................................................................
The Breakpoint View..................................................................................................
Breakpoints that Don't Stop Execution of Your Program..........................................
Disabling Breakpoints..............................................................................................
Conditional Breakpoints..............................................................................................
The Loaded Classes View...........................................................................................
Classes with Tracing Disabled......................................................................................
Taking Stock...................................................................................................................
Finding the Bug in a Program.......................................................................................
Debugging Threads..........................................................................................................
Reminders and Hints....................................................................................................
Garbage Collection......................................................................................................
Summary.....................................................................................................................
Chapter 26..............................................................................................................................
Unit Testing with JUnit.............................................................................................................
Unit Testing in the Enterprise Version...................................................................................
Adding Tests of the CodeBox Class............................................................................
Testing Methods that Return Strings.............................................................................
Test Fixtures...............................................................................................................
Test Suites......................................................................................................................
Running JUnit tests from the Command Line.....................................................................
Running Tests in Text Mode........................................................................................
JUnit and Ant..................................................................................................................
Summary.........................................................................................................................
Refactoring..............................................................................................................................
Refactoring Packages......................................................................................................
Getting Ready to Refactor...........................................................................................
Renaming in the Enterprise Version..............................................................................
Renaming in the SE Edition..........................................................................................
Refactoring Continued.................................................................................................
Renaming Classes, Methods and Fields............................................................................
Renaming the .jpx file.......................................................................................................
Renaming the Root Directory for your Project..................................................................
Undoing a Refactoring.....................................................................................................
Using the Package Browser to Set Your Main Class........................................................
The Need to Rebuild...................................................................................................
The Wrong Way to Change a Class Name.......................................................................
The Right Way to Change a Class Name.....................................................................
Refactoring Using JBuilder Personal.................................................................................
Changing a Package Using JRefactory.........................................................................
Changing a Class Name Using JRefactory....................................................................
Summary.........................................................................................................................
Introduction
to the OpenTools API..........................................................................................
An Example of What you can do with the OpenTools API...............................................
Creating a Simple OpenTools Project..............................................................................
Implementing A Simple Command Line Based OpenTool.............................................
Working with the Command Interface..........................................................................
Registering Your OpenTool.........................................................................................
Using the JBuilder IDE to Create an OpenTool................................................................
Running a Simple OpenTools Project...............................................................................
The classes.opentools File...........................................................................................
OpenTools and the Archive Builder.............................................................................
Developing an OpenTools Jar file from the Command Line...........................................
Running an OpenTool from its Project Directory..........................................................
Creating a GUI Tools Project..........................................................................................
Using the JBuilder IDE to Create an OpenTool............................................................
The Code for the GUI Open Tool................................................................................
Summary.........................................................................................................................
Java Bean Basics.................................................................................................................
Overview........................................................................................................................
What is BeansExpress?...............................................................................................
Beans and the Personal Edition....................................................................................
Defining our Terms......................................................................................................
Creating a Simple Bean...................................................................................................
Testing Your Bean with BeanInsight.............................................................................
Adding a Property to Your Bean.....................................................................................
BeanInfo.........................................................................................................................
Understanding SimpleBeanInfo....................................................................................
Exposing and Hiding Ancestor Properties.....................................................................
Using Your Bean.............................................................................................................
Enhancing Your Bean..................................................................................................
Exercises.........................................................................................................................
Bound and Constrained...............................................................................................
Summary.........................................................................................................................
JavaBean
Harvest............................................................................................................
Wrapping Swing..............................................................................................................
Creating the ElfList Box...................................................................................................
List Boxes and ArrayList and Streams.........................................................................
The ElfScrollListBox........................................................................................................
Marking Code as Deprecated..........................................................................................
Ext Directories............................................................................................................
The Future of Visual Development...................................................................................
Summary.........................................................................................................................
JavaBeans
and Properties........................................................................................................
A Clock Bean.................................................................................................................
Adding Properties to a Bean........................................................................................
Initializing the Timer.....................................................................................................
Enhancing the Clock Component.................................................................................
Override an Existing Property......................................................................................
Directly Painting the Text on the Control......................................................................
Overriding the Paint Method........................................................................................
Improving the Control..................................................................................................
Exposing Properties for the New Clock.......................................................................
Exposing Events for the New Clock.............................................................................
Summary.........................................................................................................................
JavaBeans,
Packages and Java 2D..........................................................................................
Creating Version 1.0 of the Clock....................................................................................
Moving Files to a New Package..................................................................................
Path Issues: Creating Files in a New Directory.............................................................
Upgrading the Interface of the Clock................................................................................
Drawing LCD Numbers with Graphics2D....................................................................
The Enumerated Type.................................................................................................
Summary.........................................................................................................................
BeanInsight
and Jar Files.........................................................................................................
Bearing Fruit...............................................................................................................
Using BeanInsight........................................................................................................
Understanding Jar Files....................................................................................................
Creating a Jar File for your Bean..................................................................................
Creating Jar Files from the Command Line...................................................................
Using the Archive Builder to Create a Jar File..............................................................
Placing the Bean on the Component Palette..................................................................
Building a Test Applet.................................................................................................
Adding Component Palette Icons to your Bean............................................................
Creating a Fancy Manifest File.....................................................................................
Working with Ant Files................................................................................................
Summary.........................................................................................................................
Introduction
to Database Programming....................................................................................
Target Audience..............................................................................................................
What is JDBC and what Does DataExpress Have to do with It?.......................................
What is a Database Server?.............................................................................................
SQL Servers and Local Databases..............................................................................
What is a Relational Database?....................................................................................
What is SQL?.............................................................................................................
What is a DataSet?......................................................................................................
Preserving a Relational Database's Integrity..................................................................
Cascading Deletes.......................................................................................................
Keys and Indices.........................................................................................................
Validity Checks, Keys and Differences between databases...............................................
What is a Database Driver?.............................................................................................
JDBC vs ODBC.........................................................................................................
Summary.........................................................................................................................
Database
Setup.......................................................................................................................
Working with Different Databases....................................................................................
Setting up MySQL on Windows......................................................................................
Starting MySQL as a Standalone Application on Windows..........................................
Shutting Down the MySQL StandAlone Server On Windows......................................
Starting and Stopping MySQL as a Windows Service..................................................
Setting up MySQL on Linux............................................................................................
A GUI Front End for MySQL.........................................................................................
Creating Users and Passwords in MySQL.......................................................................
More on Working with User Accounts.........................................................................
Creating Simple Databases and Tables.............................................................................
Introduction to InterBase.................................................................................................
Downloading InterBase...............................................................................................
Installing InterBase on Windows and Linux..................................................................
Testing InterBase on Windows and Linux.....................................................................
Creating Data for Use with this Book...............................................................................
Creating Tables for MySQL........................................................................................
Creating Tables for InterBase..........................................................................................
Creating Tables for Access..........................................................................................
Loading the Raw Data.................................................................................................
Setting Up Your Windows Environment.......................................................................
Setting Up Your Linux Environment.............................................................................
Setting Up Ant............................................................................................................
Too Many Options?........................................................................................................
Summary.........................................................................................................................
Connecting
to Databases from JBuilder............................................................................
Installing MySQL Drivers................................................................................................
Installing mm.mysql..........................................................................................................
Working with the Installed mm.mysql Driver.................................................................
Installing MyODBC on Windows or Linux...................................................................
Setting up InterBase........................................................................................................
Setting up InterClient on Windows...............................................................................
Setting up InterClient on Linux.....................................................................................
Testing InterClient.......................................................................................................
InterBase and JBuilder on Windows............................................................................
InterBase and JBuilder on Linux...................................................................................
Installing ODBC for Access.............................................................................................
Testing Your Work.........................................................................................................
Summary.........................................................................................................................
Database
Basics......................................................................................................................
Data Modules.................................................................................................................
Creating a Data Module..............................................................................................
Before Leaving the Data Modeler................................................................................
Letting JBuilder Construct Your Application.....................................................................
Saving Data: The Nav Bar...........................................................................................
A Singular Manner for Constructing the Data Module.......................................................
Opening a Database....................................................................................................
QueryDataSet and Querying a Database......................................................................
How JBuilder Retrieves Data.......................................................................................
Monitoring SQL Activity.............................................................................................
Data Module Access Methods....................................................................................
Examining the Generated Application...............................................................................
Code Generation and Templates..................................................................................
The ClientResource.....................................................................................................
Summary.........................................................................................................................
Database
Techniques...............................................................................................................
One to Many Relationships..............................................................................................
Creating a One to Many with the Data Modeler...........................................................
Creating a One To Many by Hand...............................................................................
Examining the Resource Bundle...................................................................................
Displaying the One to Many Relationship to the User....................................................
Calculated Fields.............................................................................................................
Editing Your Data............................................................................................................
Editing the Calculated Field..........................................................................................
Using the dbDisposeMonitor and other Utilities................................................................
Summary.........................................................................................................................
Database
Strategies.................................................................................................................
Searching........................................................................................................................
Using JdbNavField......................................................................................................
Searching with Locate and LookUp.............................................................................
Lookups and PickLists....................................................................................................
Creating a Program that Contains Lookups..................................................................
An Introduction to the JBuilder Column Object............................................................
Restoring Your Program..............................................................................................
Wrapping Up Your Application in Jar File or Executable..................................................
Summary.........................................................................................................................
Data Control...........................................................................................................................
Updating, Inserting and Deleting.......................................................................................
Insertions and Auto-Increment Fields...........................................................................
Creating an Auto-Increment Program...........................................................................
Deleting a Row............................................................................................................
Inserting A Row..........................................................................................................
ReFinding Your Place in a DataSet with Simple Searches.............................................
A First Try at Getting the AutoIncrement Value from a Server......................................
An Improved way to get the Auto-Increment Value from the Server.............................
Adding or Appending a Row to a Dataset....................................................................
Updating a Row..........................................................................................................
Emptying a DataSet.....................................................................................................
Summary.........................................................................................................................
Parameterized
Queries, Columns, and Transactions..................................................................
Getting more Control of SQL Queries..............................................................................
Locking Tables............................................................................................................
Parameterized Queries and Column Objects....................................................................
Adding a Join to the Params Program..........................................................................
More on the Column Class..........................................................................................
A Quick Glance at the EasySQL Program...................................................................
Transactions....................................................................................................................
Transaction Isolation Levels.........................................................................................
Additional Sample Programs............................................................................................
Summary.........................................................................................................................