Overview

X-Ray Spex Tutorial

So, you have a NetBeans build sitting around, are thinking about writing a module, and are wondering...well, what is NetBeans doing as it stands (that I can change)? Looking through the APIs can give you details about how each little piece works, but you may want a tour of the Open APIs to see how they all fit together in the application.

This "x-ray" tutorial is based on the standard NetBeans tutorials for new users. They are an excellent example of the kinds of operations that end-users normally work with. In italics is the regular tutorial; as commentary on each section, there is a description of what APIs are really being used and how. The original tutorial is a little out of date now, but generally only in superficial ways.

These descriptions are not intended to be 100% complete in the way that a Java-level trace would be. Rather, they should give you the basic idea of how the APIs are being used in context. If you need all the details, then of course a Java debugger or profiling/tracing tool would be more appropriate. Similarly, the real implementation code sometimes uses a slightly different approach than is described here, whether for efficiency or for special UI purposes; however, as a rule the described calls are functionally equivalent.


Tutorial One : The Clock

For this tutorial, we will start with a simple clock form, making use of the built in TimerBean. Once we have this clock compiled and running successfully, we will then extend its functionality, adding the ability to set the time, and change the time and date format.

Let's start with the basic clock.

PART ONE - the Clock.

Startup :

Add a component :

Modify the component's properties :

This completes the visual aspect of the first stage of this tutorial. Now we will add functionality to this form, by adding the TimerBean, and adding some code.

Functionality - Adding Code :

Add the TimerBean, and set an event handler :

Compiling and Executing the form :

That's it!

form

Again assuming there are no errors, your clock should be displayed, showing the correct current time, with the seconds incrementing normally.

You've just built your first form !

To close the form, right-click on it in the Execution View, and select Terminate Process. Note that while you can also terminate this form by closing the form window, this relies on the WindowClosing event being set. The JFrame Template we used to build this form has this event set to close the application as a default setting. Without it, closing the window would not actually terminate the process.
The Execution View nodes have an action in their popup menu permitting the associated process to be terminated using ExecutorTask.stop().


Tutorial Four : The Debugger

In this tutorial we will demonstrate the use of the debugging subsystem of the IDE. We will use the completed code for one of the earlier tutorials - part three of Tutorial One, the advanced version of the Clock. The completed code for this tutorial (and all other tutorials) is included with NetBeans, and can be found under Development/tutorial/ in the NetBeans Explorer.

The Debugger allows you to set and remove breakpoints, watch variables, track the state of threads, and more. All of this can be done in an easy and intuitive graphical user interface.

Preliminary Setup :

Working with Breakpoints

Set a breakpoint
The Debugger Window

Watching Variables

Watching variables

Threads

Other Features


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.