This chapter provides you with overviews of:
To restore the JBuilder default environment,
jbuilder\bin\jbuilder.ini
.
jbuilder.ini
file is created.
The Main window is at the top of the screen when you open JBuilder. It contains the menu bar, the toolbar, the Component Palette, and the status bar.
The following table provides brief descriptions of menu commands.
Menu | Commands for... | |
File menu | Creating, opening, closing, renaming and saving files and projects; setting project properties; removing files from projects; configuring printers; printing files. | |
Edit menu | Copying, pasting, deleting, and selecting text; undoing and redoing actions. | |
Search menu | Finding and replacing text; searching for text incrementally and by line number; searching for text across a source path; searching for a symbol. | |
View menu | Viewing Debugger windows, a new AppBrowser, the next or previous error message, the toolbar, the Component Palette, or other currently open AppBrowsers. | |
Build menu | Making or building the selected node. | |
Run menu | Running an application or applet; stepping over or tracing into code; running to the end of a selected method; pausing the program; setting watches or breakpoints; inspecting, evaluating, and modifying. | |
Wizards menu | Running wizards for tasks such as implementing an interface, overriding a method, bundling resources, migrating data, and examining a JavaBean. | |
Tools menu | Displaying the Environment Options dialog; invoking the Windows Notepad and Calculator; invoking remote object creation tools; and setting default properties for new projects. | |
Workgroup menu | Setting up version control and managing workflow. | |
Help menu | Displaying documentation, such as the Help system, Creating JavaBeans with BeansExpress, the JDK API Reference, and the JBCL Reference. Also for viewing the Borland Online web site in your default web browser, loading the Welcome project for experimenting, and seeing information about this release of JBuilder. | |
Icon | Menu Equivalent | Description |
![]() |
File|Open | Opens a project, file, or package. |
![]() |
File|Close | Closes the current window. |
![]() |
File|Save File | Saves the current file. |
![]() |
File|Save Project | Saves the open projects and files, using the current names. |
![]() |
Edit|Undo | In the Editor, reinserts any characters you deleted, deletes any characters you inserted, replaces any characters you overwrite, or moves your cursor back to its prior position. In the UI Designer, undoes actions. |
![]() |
Edit|Redo | Reverses the effects of an Undo. |
![]() |
Search|Find | Searches for text within the current file. |
![]() |
Search|Replace | Replaces specified text with other specified text in the current file. |
![]() |
Search|Search Again | Finds the next occurrence of a search string in the current file. |
![]() |
Search|Browse Symbol | Loads the specified class into the AppBrowser. The class must be on the import path of the current file. |
![]() |
Run|Run | Compiles and runs your application using the startup parameters specified in the Run/Debug page of the Project Properties dialog box. |
![]() |
Run|Debug | Compiles your program and runs it in the Debugger using the startup parameters specified in the Run/Debug page of the Project Properties dialog box. |
![]() |
Build|Make | Compiles any .java files within the selected node that have outdated or nonexistent .class files. Also compiles any imported files that the node depends on which have outdated or nonexistent .class files. |
![]() |
Build|Rebuild | Compiles all .java files within the selected node, regardless of whether their .class files are outdated. Also compiles the imported files upon which the node depends, regardless of whether their .class files are outdated. |
Place the mouse over a component, without clicking, to see the name of the component's class reference.
JBuilder comes installed with the following pages:
Page | Description | |
JBCL | Components in the JBCL Control package | |
JBCL Containers | Containers in the JBCL Control package | |
DataExpress | Components in the following JBCL packages: | |
dbSwing | Components in the JBCL dbSwing package | |
Swing | Components in the JFC Swing package | |
Swing Containers | Containers in the JFC Swing package | |
AWT | Components in the Java AWT package | |
KLGroup | Components in the following KLGroup packages: | |
Other | Other locally installed third-party components |
If there is a compilation error, the Error pane, below the Content pane, details the compilation error.
To simplify your job, JBuilder introduces a new concept in user interfaces for development environments: a single AppBrowser that is used to perform all the usual development functions. The JBuilder AppBrowser lets you to explore, edit, design, and debug all in one unified window.
The JBuilder AppBrowser usually fills the screen area below the Main window. If you are running JBuilder, and don't have an AppBrowser displayed, choose Help|Welcome Project to view it. The AppBrowser will look like the figure in the section called Starting JBuilder.
Choose of the following topics for more information about the AppBrowser:
The AppBrowser usually contains three panes:
Although you will usually have only one AppBrowser visible, you can open additional AppBrowsers as needed, for example, to view more than one project at a time. Use View|Windows to switch between AppBrowsers.
You can select a file in the Navigation pane by clicking it. The Content pane and the Structure pane display information about the selected file. As you select different files in the Navigation pane, each one will be represented in the Content and Structure panes.
The following table lists the editor or viewer used in the Content pane. The editor or viewer is determined by the extension of the file selected in the Navigation pane.
File Type | Editor(s) or Viewer (s) available in the Content pane |
Text files | If you select a text file in the Navigation pane (a file with an extension such as .txt or .bat), an editor, identified by the Source tab, is available in the Content pane. This is a simple text editor that lets you to see and modify the text file.
JBuilder recognizes certain file extensions (such as .txt and .bat) as text files. However, you can extend this list. For more information, see Extending JBuilder's list of text file extensions. |
Image files | If you select a .gif, .jpg, or .bmp image file in the Navigation pane, an image viewer, identified by the View tab, is available in the Content pane. |
.html files | If you select an .html file in the Navigation pane, two tabs are displayed at the bottom of the Content pane, labeled View and Source.
|
.java files | If you select a .java file in the Navigation pane, you see four tabs labeled Source, Design, Bean, and Doc.
|
You can expand the Content pane to fill the entire AppBrowser window. You simply toggle it in and out of full window mode with the View|Toggle Curtain menu command or with the shortcut keys (Alt+Z in the default key mapping). When the Content pane is expanded, the Structure and Navigation panes are hidden.
You can also use the mouse to resize the window or any of its panes by dragging the pane boundaries.
Extending JBuilder's list of text file extensions
JBuilder recognizes certain file extensions as being text files. The file extension controls what type of file can be opened in the Content pane. If you find that you need to treat some other file extension as a text file type, you can extend JBuilder's list.
To define which file types to treat as text files,
For example, if you select a .java file, the Structure pane will show you structural information about the java code in that file, such as
This structural information is in the form of a hierarchical tree. You can think of the Structure pane as a table of contents for the file.
Navigating .java files using the Structure pane
Not only does the Structure pane show you the structure of your file, you can also use it as a quick navigation tool to the various structural elements in the file. For example, if you have selected a .java file, you see classes, variables, and methods in the Structure pane. You can then click on any of those elements in the Structure pane and the Content pane will move to and highlight that element in the source code.
This gives you a much faster way to browse and find the elements of a .java file than scrolling through it or searching for a word.
You can also use the Structure pane for drilling down into other ancestor classes and interfaces.
Drilling down into other classes and interfaces
Often, you need to look at .java files that are not part of your project, but which are referred to in the class you are editing. To see the .java file for an ancestor class, an interface, or the type of a variable shown in the Structure pane, just double-click it or select it and press Enter. The AppBrowser will go to that file, showing it in all three panes.
Follow these steps for an example of drilling down:
The stub source is only generated temporarily in memory, and it is not saved to disk.
The Component Tree
When you have selected a .java file and then select the Design tab at the bottom of the Content pane, the Structure pane displays the designable objects in the file, and how they are nested and interrelated. This view is called the Component Tree. For more information, see the "Using the Component Tree" chapter.
The AppBrowser can display the following modes:
To return to the starting state and see your code, click the Project tab, then the Home button.
See also:
Tabs in the AppBrowser
If you find a file you want to open, select it in the Navigation pane. File details are displayed in the Content pane and file structure is displayed in the Structure pane.
See also:
Getting Started with JBuilder: Creating and managing projects
If you find a file you want to open, select it in the Navigation pane. File details are displayed in the Content pane. File structure is displayed in the Structure pane just as if it were a file in your project.
You can quickly add a file to your project from the Directory Browser by clicking it and dragging it to the Project tab.
You can remove the Directory tab from the AppBrowser display by right-clicking it and choosing the Drop Directory Tab command. To view the Directory tab again, right-click the Project or Opened tab and choose View Directory tab.
Click the Opened tab to display a list of your currently active or open files. Your open files are
Here are some reasons the Opened Files Browser is useful:
Adding files to the Opened Files list
If you need to frequently refer to a file that you have found using drill down or any other navigation method, you can drag it from the Navigation pane to the Opened tab, to put it into your Opened Files Browser where you can quickly look at it again later.
While debugging, you can switch to any of the other tabs to review files in your project, browse directories, and look up reference information without disturbing your debugging session or cluttering your screen.
See also:
Building Applications with JBuilder: Debugging Java programs
You can remove the Hierarchy tab from the AppBrowser display by right-clicking it and choosing the Drop Hierarchy Tab command.
You can remove the Search tab from the AppBrowser display by right-clicking it and choosing the Drop Search Tab command.
Navigating the history list
The Home, Prior, and Next buttons above the Navigation pane allow you to traverse the history list.
Button | Description |
![]() |
Moves to beginning of history list. |
![]() |
Moves to prior item in history list. |
![]() |
Moves to next item in history list. |
Navigating the AppBrowser trees
You can use the keyboard to navigate the trees displayed in the Navigation pane, the Structure pane, the Watch pane, and the Debugger pane:
Normally, entries beginning with the specified text are selected. Use wildcard characters to change this behavior:
The keystroke command used to record keystrokes depends on which keyboard emulation you have selected as the default in the Editor. (This feature is not available when using the Epsilon keyboard emulation.)
To record keystrokes,
Recorded keystrokes can be played back in a different AppBrowser than the one in which they were typed. If, for example, you have more than one project open at the same time, and you record keystrokes in the Content pane of one AppBrowser, you can switch to another project and play back the recorded keystrokes in its Content pane.
Option | Description |
Reload Last Opened Project Upon Startup | When you start JBuilder, automatically reloads the most recently opened project. |
Grouping | Controls the display of the Structure pane. You can choose to separate data members and methods and group items by accessibility (for example, private, protected, public, package). |
Accessor Sorting | Rearranges the order in which .java files are displayed in the Structure pane. |
Structure Sorting | Rearranges the order in which properties, methods, events, and data members are displayed in the Structure pane. |
Inspector | Controls how the Inspector is displayed in the UI Designer. The Inspector can float to the right of the UI Designer or be embedded in it. |
To display the Editor, first navigate to the text file you want to view or modify. Then click the Source tab at the bottom of the AppBrowser. The file is displayed in the Content pane, ready for editing.
Choose one of the following topics for more information:
Task | Command | |
Go to a specific line number | Search|Go To Line Number | |
Browse through a class, interface or package | Search|Browse Symbol | |
Find and replace text | Search|Find and Search|Replace | |
Search for text incrementally, as you type in the search string | Search|Incremental Search. The search begins from the cursor's location in the file. It does not start from the beginning of the file. | |
Search for text across all files in selected path(s) | Search|Search Source Path | |
Set bookmarks and return to them | Key combinations, listed in keymap files | |
Choose one of the following topics for more information:
Code completion
Code completion is a quick way to select all appropriate method calls for any given reference prefix. You can also enter a class name to see valid method, property, and event names. The code completion feature can also be used to complete assignment statements.
To activate code completion,
Package browser
The Package browser is a dialog that lists all available packages. To display the browser, press Ctrl+Alt+Space when you are editing source code.
When the browser is displayed, choose the name of the package you want to insert in your code and press Enter or double-click.
Parameter lists
When you are coding a property, method or event, a list of expected parameters, with the correct syntax, can be displayed. All possible parameters are displayed, including overloaded ones.
To display the parameter list, type a property, method, or event and press Ctrl+Shift+Space. When the list is displayed, choose the item you want to insert in your code, then press Enter or double-click.
Tool tip expression evaluation
When you are debugging a program, you can place the mouse cursor over any variable in the Editor to display its value. The value is displayed in a small popup window that looks like a tool tip.
Configuring Code Insight
Use the Code Insight page of the Environment Options dialog box (Tools|IDE Options) to configure Code Insight options.
To configure Code Insight,
Option | Description |
Syntax Highlight Declaration Errors | Code Insight willl automatically use the color specified for the Illegal element on the Colors page of the Environment Options dialog to highlight declaration errors in your code. |
Parse Delay | Sets the duration of the pause before the prefix is parsed. |
Auto Completion Enabled | Activates the code completion feature. |
Auto Parameter List Enabled | Activates the parameter list display. |
To customize your coding style,
Option | Description |
Braces | Determines how braces are inserted. Choose End Of Line to append the right brace to the end of the existing line. The Next Line option inserts the brace at the beginning of the following line. |
Event Handling | Determines how event handlers are created. Choose Anonymous Adapter to to create event handlers using anonymous inner classes. Choose Standard Adapter to use separate adapter classes. The Match Existing Code option creates event handlers using the existing method.
For more information about anonymous adapters, see the topic Using anonymous adapters in the "Working with events" chapter of the Component Writer's Guide. |
Use Beans.instantiate() | You can instantiate objects by using Beans.instantiate() as well as new.
For more information, see the Instantiating serializable JavaBeans in the "Serializing JavaBeans" chapter of the Component Writer's Guide. |
To add your own files to the Object Gallery,
For more information, see Creating JavaBeans with BeansExpress.
The following table presents an overview of the wizards. For more information on a specific wizard tool, display the wizard and click the Help button or press F1.
File wizards
Wizard | Description | |
JavaBean Wizard | Creates a JavaBean ready for you to customize with BeansExpress. | |
Project Wizard | Creates a new project. If you invoke any of the other File wizards when you don't have a project open, the Project Wizard is automatically invoked first. | |
Application Wizard | Creates a new Java application shell which contains a Frame. | |
Applet Wizard | Creates a minimal applet and HTML file which contains the applet. | |
New Frame Wizard | Creates a new frame. | |
New Dialog Wizard | Creates a new dialog. | |
New Panel Wizard | Creates a new panel. | |
New DataModule Wizard | Creates a new data module. | |
New Class Wizard | Creates a new class. | |
HTML Wizard | Creates an HTML file. (This wizard does not have a user interface.) | |
Servlet Wizard | Creates a servlet. | |
Utility wizards
Wizard | Description | |
Override Methods Wizard | Creates skeletal code to override a method in a superclass. | |
Implement Interface Wizard | Creates skeletal code that tells other objects that the selected class can be accessed via a certain Java interface. | |
Resource Strings Wizard | Bundles resources into separate classes to enable localization. | |
Deployment Wizard | Creates a .jar or .zip archive file of all the specified project files. | |
Use DataModule Wizard | References a selected data module in your application. | |
Data Migration Wizard | Migrates data between desktop database tables and SQL database servers. | |
BeanInsight | Examines a class to determine if it is a valid JavaBean. | |
Enterprise JavaBean Wizard | Creates an enterprise JavaBean component. | |
Remote Objects wizard
Wizard | Description | |
Generate CORBA Server Wizard | Creates a CORBA server that makes the CORBA object available to the ORB. | |