Java Madness: JBuilder Foundation for Beginners

Copyright (c) 1999 by Charlie Calvert

Introduction

Welcome to the Java Madness! This computer programming course is an ongoing project designed to bring people who are interested in programming up to speed on developing applications and applets in Borland JBuilder Foundation.

The articles in this course are for readers who have little knowledge of programming. I do however, assume that you have a basic understanding of computers, and a basic understanding of the fundamentals of running applications on your chosen platform, be it Linux, Windows or Solaris.

This course will focus mostly on understanding the Java language and using the JBuilder Foundation edition. Much of the text is designed to explain the basic syntax of java, and how to use that syntax inside the JBuilder environment. One can do nothing with a programming language if they do not first understand its structure and syntax.

The text will cover creating applications, the basic java types, and fundamental programming operations such as loops, branching and recursion. Since Java is object oriented from the ground up, I will also focus on how to use objects to create a robust, reusable and easy to maintain structure for your applications. That discussion of objects will, of course, cover the creation of JavaBeans.

I have decided to devote a portion of the text to covering applet creation for not only Java 2, but also the JDK 1.02 and JDK 1.1.1 platforms. 

Focusing some of the text on applets is for some people a unusual decision, since JBuilder is a powerful programming environment designed to allow developers to create mission critical applications. In the Java programming world, significant distinctions are made between applets and applications, and many serious developers focus on creating applications. 

Borland's recent decision to release JBuilder Foundation at no charge has prompted me to create a course for the average or aspiring developer. My belief is that those developers will want to create not only applications, but also applets. As a result I will dedicate a portion of the text to understanding how to write applets with JBuilder. I will, however, also dedicate large parts of the text to covering basic application development.

By the time you are done, you should know all about swing, Java 2, and other cutting edge language features. However, I know that other people are interested in creating applets that will run on a wide range of browsers, and so I will be sure to also look after their interests.

Intended Audience

This book is aimed at people who have a general interest in programming Java. I want to keep things simple and general enough to appeal to a wide range of readers.

If you want to learn Java, or if you have a web site and want to start adding simple Java programs to your web pages, then you should find this text enjoyable. The articles I'm creating are meant to be a resource for  all programmers, but they are aimed particularly at people who are relatively new to programming, or new to Java.

On the whole, the text is designed to be as simple and easy to understand as possible. However, the end of some of the articles may contain a section aimed at advanced programmers who want to dig a little deeper into the subject matter. Furthermore, I assume at least a basic understanding of simple programming concepts such as variables and types. If you have taken any programming 101 course, or if you have managed to teach yourself a little of some programming language, then you should be able to handle this text.

Programmers who work in a corporate setting will hopefully find this text a useful introduction to Java, and to using JBuilder. I'll cover most of the features of the IDE which are available in the Foundation edition. This includes how to use the visual tools such as the component palette, structure pane, and inspector. I will also discuss fundamental Java related issues such as layouts and events, taking the time to show how these features are handled relatively automatically in the JBuilder IDE.

Though I dedicate considerable time to distributed computing in other texts I've created, for now I don't currently plan to pursue that avenue in this particular course. Instead, I'm going to show how to create Java code that would be of use in general application development, in web development, or to those who just want to have  fun with a programming language. This does not mean that this course will not be syntactically rigorously correct, or intellectually stimulating, but only that it is not focused specifically on the needs of programmers who want to create large distributed applications.

I will do everything I can to show how to create fun and interesting programs. Java is new and exciting, and people want to have a little fun with it. Once we can get past the very basics, I want the example programs used in the text to reflect that fact. In particular, there will be an emphasis on graphics, sound, and animation.

A Work in Progress

The articles that make up this course are currently under development. When I am through, this text will be a complete course in creating simple applets and applications in JBuilder. However, I am going to be developing the chapters in the course one at a time, and publishing them as they are developed. The tentative goal is to publish one new chapter a week. At this time the extent of the course is not clear.

Work on the text was begun during December, 1999. It is possible, particularly during the early stages of development, that the focus of the text will change to meet the needs of its readers. If I get feedback that suggests I am not properly focusing the text, then I will make appropriate changes. The ability to respond to readers in this dynamic fashion is one of the advantages of the web, and I have every intention of taking advantage of internet technology.

In part because the text will change over time, in part because it is my personal intellectual property, and in part because the text is designed to highlight programming in Borland JBuilder, it is not possible for you or anyone else to publish or mirror this text on any other site other than Borland's site or my own personal site. You are free to link to these pages from other sites, and you are free to download the text for offline viewing. However, you may not publish this text on your own site, on your company site, or on any other site.

Understanding JBuilder Foundation

The programs in this book are designed to be created with JBuilder Foundation. This powerful free compiler is built entirely in Java. Everything you see in the tool, including the editor and debugger, are written using standard Java APIs. At the time of this writing, you can download JBuilder Foundation from the Borland website.

Because JBuilder is written entirely in Java, it can run on multiple platforms. For instance, it runs on Solaris, Windows and Linux. At this stage in my life, my personal preference is to use Linux. However, I have many years experience working with Windows, and so I will include tips for working in that environment.

JBuilder Foundation is the "base" or "foundation" on which the regular JBuilder package is built. Borland is willing to give this product away for free because it does not include all the fancy tools that come with the other versions. Their hoping that wide use of this product will help seed an interest in upgrading to the full version of the product. People can, however, build on this powerful foundation, adding new tools that add more functionality to the base product. 

When you are moving through the JBuilder menus, dialogs and toolbars, you will find that certain options are grayed out. These options would be available in some of the regular versions of JBuilder, but they are unavailable in the free version.

Obviously the Borland marketing department hopes that these grayed out options will entice you to buy the regular version of the product. For the purposes of these articles, however, I will ignore those other versions completely. Everything I write about in these articles are things that you can do in the free version of JBuilder. Indeed, Borland definitely wants us to use this product. It is a foundation on which we can build some very fancy tools, and my goal in these pages is to show how to proceed.

About the Author

To get a feeling for the flavor of this text, it might help if you know a little bit more about me. My name is Charlie Calvert and I have been programming on a regular basis for about ten years. Most of my programming experience has been with Pascal and C++. I have been casually experimenting with Java for about two years, but I do not have nearly as much experience with this language as I do with C++ or Pascal. As a result, there are occasions when you might want to write me with suggestions on ways to improve my code or syntax.

Please do not write me with technical questions that are not directly related to the articles in this text. For instance, if you cannot get one of the programs in this text to work, or if you feel my explanations of particular technical matters are unclear, then feel free to write me. However, I will not reply to general technical questions. If you want additional technical help, see Appendix A.

Before I began working in the computer industry, I was a journalist and occasional short story writer. I have a BS in Computer Science and a BA in Journalism. English literature was the focus of my most serious study while in college, and I tend to think of myself as both a writer and a programmer.

My background leads me to put a good deal of attention on writing clean, easy to understand prose. Above all, I want to be readable, and I hope that on occasion I can make my prose spirited and at least moderately enjoyable. In short, I will aim first to communicate my ideas in a clear and easy to understand fashion, and will not risk confusing the reader by attempting to show off.

Summary

Its time now to get started writing some code. I love to program, I love Java, and I love working in an all Java version of JBuilder. This whole project is very exciting to me, and I hope that you can share in my enthusiasm for the art of programming, and my love for powerful object oriented languages like Java.

Go ahead now and proceed to Chapter One, where you can learn about the JBuilder IDE. Once you know how to get around in the environment, you can move on to Chapter Two, where I show how to create a simple Applet using JBuilder. The third chapter will show how to publish that applet on the world wide web. After that, we will begin a more in depth examination of Java, including its basic types, its event model, creating standard applications with swing, and building JavaBeans.