|Developer's Daily||JBuilder Education|
|main | java | perl | unix | DevDirectory|
I've found that a couple of really nice, time-saving features in JBuilder are not easily found. On of these great features is JBuilder's Class Browser. In this tutorial, I'll show you how to start JBuilder's Class Browser from within the editor, and I think you'll quickly see the benefits.
Starting the Class Browser
For the purposes of this tutorial, I've created a simple DemoClass, as you can see in Figure 1. Notice that the area I'm about to type in is highlighted in yellow (this actually comes from one of JBuilder's great OpenTools projects).
|Figure 1:||A view of the DemoClass before starting the Class Browser.|
Using the Class Browser is simple and painless. Just move to the area you want to type in, then hit the magic keystroke:
When you do this, you'll see the Class Browser appear, as shown in Figure 2. This first high-level view of the Class Browser shows all of the top-level packages and classes JBuilder is aware of in your current project.
|Figure 2:||What the Class Browser looks like when it is started.|
The display changes as you type
The first great thing about the Class Browser is that, as you type the package name corresponding to the class you want to instantiate, the class browser position changes to reflect what you type. So in my example, as I type
java.util.Link, the appearance of the Class Browser changes to reflect what I have typed, as you can see in Figure 3.
|Figure 3:||The Class Browser moves into packages as you type.|
The class you select is automatically imported
The second great feature of the Class Browser is that the class you eventually select is automatically imported into your project for you, as you can see in Figure 4. Here I've highlighted the
import statement to emphasize the work JBuilder just did for you. In reality your cursor position will pick up right where you left off typing.
|Figure 4:||JBuilder creates the import statement for you automatically.|
One or two other uses
I also use JBuilder's Class Browser to explore once in a while. That is, if I can't remember where a class is within the maze of all possible classes within a project, I use the Class Browser as a nice tool to help me find that class.
As one other side benefit, I've also opened the Class Browser before and been surprised not to see a package in the Class Browser that I expected to see. This is a sure sign that I have something configured wrong within my current JBuilder project.
When you want to use the Class Browser in JBuilder, all you have to do is remember the magic keystroke:
I hope you've found this article helpful. Send me a note if you'd like to add something to this article, or if you'd like to see an article written about another topic.
Copyright © 1998 DevDaily Interactive, Inc.
All Rights Reserved.