The JBuilder environment

This chapter introduces you to the JBuilder integrated development environment (IDE). To take an introductory tour of JBuilder or view the "Release Notes" (Help|Release Notes), open the Welcome Project. Choose Help|Welcome Project from the JBuilder menu, or open the project samples/com/borland/samples/welcome/welcome.jpr and double-click the Welcome.html file in the project pane.

Working in the AppBrowser

JBuilder uses one window to perform most of the development functions: editing, visual designing, navigating, browsing, and debugging. This window is called the AppBrowser, and it contains several panes for performing these development functions. The tabbed panes that are available in the content pane depend on what kind of file you have selected in the project pane.

The AppBrowser window

JBuilder AppBrowser

You can open multiple AppBrowsers by selecting Window| New Browser and switch between them by selecting the AppBrowser from the Window menu. Each instance of the AppBrowser displays the same opened projects; however, you can open different files in the content pane of each one. All instances of the AppBrowser are synchronized, so if you have the same file opened in both, changes to that file in one instance of the AppBrowser are also made to it in the other AppBrowser.


Main menu

The main menu is at the top of the AppBrowser. For an explanation of each menu, see "JBuilder menus."

main menu



Toolbar

The main toolbar is displayed at the top of the AppBrowser under the menu bar. It is composed of smaller toolbars grouped by functionality: File, Edit, Search, Build, Run, Debug, Navigation, and Help. You can modify the toolbar display by checking or unchecking selections on the View|Toolbars menu.

main toolbar
main toolbar

The toolbar provides shortcut buttons for the following menu commands:

Toolbar buttons

Icon Menu equivalent Description
File|New Opens the object gallery where you can select from a variety of wizards.
File|Open Opens a project, file, or package.
File|Reopen Reopens a project, file, or package. Select from a history list.
File|Close Closes the current file.
File|Save File Saves the current file.
File|Save All Saves all open projects and files, using the current names.
File|Print Prints selected file or text.
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. Undoes actions in the designers. There are multiple levels of undo.
Edit|Redo Reverses the effects of an Undo.There are multiple levels of redo.
Edit|Copy Copies selected text in the editor or selected objects in the UI designer to the clipboard.
Edit|Paste Pastes the contents of the clipboard to the location of the cursor.
Edit|Cut Cuts selected text in the editor or selected objects in the UI designer to the clipboard.
Search|Find Searches for text within the current file.
Search|Search Again Finds the next occurrence of a search string in the current file.
Search|Replace Replaces specified text with other specified text in the current file.
Search|Browse Classes Loads the specified class into the AppBrowser. The class must be on the import path of the current file.
Project|Make Compiles any .java files within the selected project that have outdated or nonexistent .class files. Also compiles any imported files that the project depends on and which have outdated or nonexistent .class files.
Project|Rebuild Compiles all .java files within the selected project regardless of whether their .class files are outdated. Also compiles the imported files upon which the project depends regardless of whether their .class files are outdated.
View|Messages Toggles the message pane on and off.
Run|Run Project Compiles and runs your application using the startup parameters specified on the Run page of the Project Properties dialog box. Click the Down arrow to the right of the Run button to access the runtime configuration list.
Run|Debug Compiles your program and runs it in the debugger using the startup parameters specified on the Debug page of the Project Properties dialog box. Click the Down arrow to the right of the button to access the debug configuration list.
Search|History Returns you to the starting class or page in the history list. Click the Down arrow to the right of the button to access the history list.
Search|Back Takes you back to the previous class or page in the history list.
Search|Forward Takes you forward to the next class or page in the history list.
Help|Help topics Takes you to the online help system.



Project pane

To develop programs in the JBuilder environment, you must first create a project. A JBuilder project organizes the files you use and maintains the properties you set. JBuilder stores projects with a .jpr or .jpx extension.

See also:
"Creating and managing projects" in Building Applications with JBuilder

The project pane displays the contents of the active project in the AppBrowser. It consists of the following items:

To create a project, choose File|New Project from the main menu, or choose File|New and choose the Project icon in the object gallery. For a faster start, continue to use the object gallery wizards to create an application and additional classes.

If you have existing files or classes you want to add to your project, click the Add Files/Packages button in the project pane toolbar and browse to select a file or package. To create a new Java source file, choose File|New Class to open the Class wizard; the class you create is placed in the current project. If you choose File|New Application when a project is open, the new application is added to the current project. To add an empty file to your project, select the Add Files/Packages button and enter a name and extension in the File Name field of the Add Files Or Packages To Project dialog box.

You can freely navigate the project tree, click and multi-select files, or right-click and select items from the pop-up menu, without ever opening a file. The pop-up menu selections vary by the file type selected. Double-click or select files and press Enter to open files and display them in the AppBrowser content pane.

project pane menu

You can open as many projects in the project pane as you wish. Only one project is active at any given time. The active project appears as the selected item in the project pane drop-down list.

You can search for a particular file or package in the project pane by moving focus to the project tree and beginning to type. For more information, see "Searching trees."

Setting project properties

Use the Project Properties dialog box to set the properties for the active project. To open it, choose Project|Project Properties.

Project Properties.gif

For information about using the Project Properties dialog box, see "Setting project properties" in "Creating and managing projects" or press Help in the dialog box.

Default project properties

Default project settings are stored in an actual project called Default.jpr found in the .jbuilder4 subdirectory of your home directory. The Default.jpr file is used as a template whenever a new project is created. To change the default project properties, choose Project|Default Project Properties from the main menu.


Structure pane

The structure pane displays the structure of the file currently selected in the content pane. This structure is displayed in the form of a tree showing all the members and fields in the file. The structure pane also displays an Errors folder that contain syntax errors, if any exist. JavaDoc @todo tags in JavaDoc comments also display in the structure pane in a To Do folder in JBuilder Professional and Enterprise.

See also: "Using @todo tags in the editor."

You can quickly search for an element in a file by moving the focus to the tree in the structure pane and starting to type the name of the element you want. For more information, see "Searching trees."

Organizing the structure pane

You can change the organization and display order of the structure pane in the Structure View Properties dialog box. Right-click in the structure pane and choose Properties to open this dialog box and modify the options.

structure pane properties

These options are also available on the Java Structure page of the Editor Options dialog box (Tools|Editor Options).

Structure view properties

For a complete description of the available options, see "Java structure options" discussed in "Customizing the editor."

Navigating in the source code

In addition to viewing the structure of the class, the structure pane is a quick way to navigate to a class, method, or member in the source code. When you select an item in the structure pane, the content pane scrolls to the line that defines the item and highlights the line.

Navigating with the structure pane

You can also use the structure pane for drilling down into other ancestor classes and interfaces. To see the .java file for an ancestor class, an interface, or the type of a variable shown in the structure pane, double-click it (or select it and press Enter). JBuilder shows that file in the structure and content panes. To return to your project, click the Home button on the main toolbar.

Viewing error messages

Error messages appear in the structure pane in an Errors folder as they occur during coding. To view these messages, expand the folder and select an error message. The appropriate line of code is highlighted in the source code. For a more detailed explanation of error messages, search for "error messages" in the Help Viewer.


Content pane

The content pane displays all opened files in a project as a set of tabs. To open a file in the content pane, double-click it in the project pane, or select it and press Enter. The name of each opened file is displayed on a tab at the top of the file in the content pane. When you click a tab, that file becomes the current file.

The content pane also provides access to various file views and operations by way of the file view tabs shown at the bottom of each file window.

Content pane

File tabs

File tabs contain the names of the open files in a selected project in the content pane. Only the file tabs of open files in the active project are visible.

You can customize the tab labels in two ways: orientation and label type. Select Tools|IDE Options|Browser to set these options. See "Browser options" in "Customizing JBuilder's IDE" for a complete description.

File view tabs

The tabbed panes that are available in the content pane depend on what kind of file you have selected in the project pane. Only tabs appropriate to the open file appear below its window.

Source The Source tab displays the source code of the open file in the editor.
Design The Design tab displays several designers for the open file. Use the designer to visually design files that inherit from java.awt.Container. The designer opens in the default UI designer where you can see how the code displays in the user interface, manipulate layouts, create components, use Two-Way Tools, and modify layout properties. Several other designers are also available depending on the JBuilder edition: menu designer and column designer. Other components, such as pop-up UI elements or other non-UI JavaBean components, can also be modified in the designer using the Inspector and the component palette.
Bean The Bean tab exposes the BeansExpress property, event, BeanInfo, and property editor designers. Use them to add properties and events to your bean, choose what properties are exposed, and create custom property editors. The Bean tab is read-only in JBuilder Foundation.
Doc The Doc tab shows the API reference documentation (if available) for the class that is opened in the content pane.
History The History tab displays information that helps you manage revisions of files. It displays the source code of the active file and a revision list of previous versions of the file. The features of the history pane vary by JBuilder edition.
View The View tab displays the opened HTML file or image file in a browser or image viewer in the content pane.
Web View The Web View tab displays the output from your running web file, such as JSPs, servlets, SHTML, and HTML. For JSPs, the Web View tab displays the output from your running JSP. For servlets, this tab displays the output from the running servlet in parsed HTML. This is a feature of JBuilder Professional and Enterprise.
Web View Source The Web View Source tab displays raw HTML in the content pane. This is a feature of JBuilder Professional and Enterprise.

Enlarging the content pane

You can resize the content pane one of the following ways:


See the View menu for other pane configurations.


Message pane

A tabbed message pane appears at the bottom of the AppBrowser for displaying hierarchical user messages from different processes, such as compiling, debugging, or running.

Tabbed message pane

JBuilder generates a new tab at the bottom of the message pane for each new process. These tabs enable you to interact with the running process. An icon on the tab indicates that a process is active and console input and output are possible through the message pane text area.

Two toolbar buttons on each tab let you stop or restart the current process. The restart button associated with a process reuses the settings in effect when the tab was initially created, ignoring any subsequent changes you may have made. Using this feature, you can set up several different configurations to be repeatedly tested.

You can run two or more processes simultaneously on the same project or different projects. A separate project tab is created for each new process started with the main toolbar Run and Debug buttons.

messagepanetabs.gif - 2364 Bytes

A Compiler tab displays during compile if there are errors or warnings.

Compile tab

During some processes, such as running, debugging, and version control, the message pane contains a status bar to advise you of the progress or result of the current process.

To show or hide the message pane, choose View|Messages or the   Messages button on the toolbar to toggle its state. You can also hide the message pane by right-clicking the message tabs and choosing Hide Messages, or pressing Ctrl+Alt+M if you are using the CUA keymappings. Remove individual tabs or all tabs from the pane by right-clicking on the message tabs and selecting Remove [name] Tab or Remove All Tabs.

To start a new run or debug process, make sure the project you want to run or debug is the active project in the project pane or the file you want to debug is the current file in the content pane. Then use the buttons on the main toolbar to start the process.

You can also copy from the message pane. Right-click in the message pane and select Copy All or select the text you want to copy and select Copy Selected Content.


Debugger

Debugging is the process of locating and fixing errors in your programs. The message pane houses the UI for the debugger.

Debugger pane

The debugger includes:

If the debugger does not appear after you choose Run|Debug, set a breakpoint on an executable statement by clicking the left gray margin of the editor and choose Run|Debug again.

Debugger views

Tab View Description
Console view Displays output from the program and errors in the program. Also allows you to enter any input that the program requires. The image displayed on the icon changes if there is any output from the program and if any error messages are displayed.
Threads, call stacks, and data view Displays the thread groups in your program. Each thread group expands to show its threads and contains a stack frame trace representing the current call sequence. Each stack frame can expand to show available data elements that are in scope. (Static data is not displayed in this view but is displayed in the Loaded classes and static data view.)
Synchronization monitors view Shows synchronization monitors used by the threads and their current state, which is useful in detecting deadlocked situations.The ability to detect deadlocked threads is a feature of JBuilder Enterprise.
Data watches view Displays the current values of data members that you are tracking.
Loaded classes and static data view Displays the classes currently loaded by the program. Expanding a class shows static data, if any, for that class. If a package is displayed in the tree, the number of classes loaded for that package is displayed.
Data and code breakpoints view Shows all the breakpoints set in the file and their current state. This view is also available from Run|View Breakpoints before the debugging session begins.
Classes with tracing disabled view Displays an alphabetically ordered list of classes and packages not to step into. This view is also available from Run|View Classes With Tracing Disabled before the debugging session begins. This is a feature of JBuilder Professional and Enterprise.

Tip: You can float all debugger views except the Console view by right-clicking in the message pane and selecting Floating Window.

The toolbar at the bottom of the debugger provides quick access to Reset, Resume, and Pause buttons, as well as Smart Step, Step Over, Step Into, Step Out, Add Breakpoints, Add Watch, and Show Current Frame buttons.

Debugger toolbar

Debugger toolbar buttons

Icon Action Description
Reset Program Ends the current application run and releases it from memory. This is the same as Run|Program Reset.
  Restart/Resume Continues the current debugging session or restarts one that has finished or been reset. This is the same as Run|Resume Program.
Pause Pauses the current debugging session. This is the same as Run|Pause Program.
Smart Step Controls whether to use the Smart Step settings in the Classes with tracing disabled view and the Smart Step options on the Debug page of the Project Properties dialog box. This is a feature of JBuilder Professional and Enterprise.
Step Over Steps over the current line of code. This is the same as Run|Step Over.
Step Into Steps into the current line of code. This is the same as Run|Step Into.
Step Out Steps out of the current function and returns to its caller. This is the same as Run|Step Out.
Add Breakpoint Adds a breakpoint to the current debugging session. Click the down-facing arrow to the right of the icon to choose the breakpoint type. This is the same as Run|Add Breakpoints.
Add Watch Adds a watch to the current debugging session. This is the same as Run|Add Watch.
Show Current Frame Displays the current thread's call stack and highlights the current execution point in the source.

For more information on debugging, see "Debugging Java programs" in Building Applications with JBuilder.


Status bars

There are three status bars in the AppBrowser. The main status bar is displayed at the bottom of the AppBrowser window and keeps you updated on any processes and their results.

Main status bar

The file status bar is displayed at the bottom of each opened file window in the content pane. It displays information specific to the current file, such as the name of the file, the cursor location (line number and column), and the insertion mode in a text file or the size of an image file.

File status bar

The message status bar is displayed at the bottom of the message pane during such processes as running, debugging, and version control.

Message status bar



Navigating and searching in the AppBrowser

Use the following keyboard shortcuts to navigate in the AppBrowser

Navigation keyboard shortcuts

Keyboard shortcut Action
Ctrl+Tab Moves forward in rotation order to the next AppBrowser pane. The rotation order is project pane, content pane, message tab, message pane text area, and structure pane.
Shift+Ctrl+Tab Moves backwards in rotation order to the previous AppBrowser pane.
Up/down arrows Moves the selection cursor up and down in a tree.
Left/right  arrows Project and structure pane - expands and collapses top level tree node branches .
Enter Project pane - opens a selected source file. This is equivalent to a double-click.
Structure pane - drills down into the superclass or interface of the selected class. This is equivalent to a double-click.

Searching trees

To search in the project pane, structure pane, and message pane, move focus to the pane and start typing. A tool tip box is displayed in which you can define a search filter. By default, the first matching entry is selected. The next and previous entries are selected with the Up and Down arrow keys. Press Esc to cancel the search mode. Collapsed nodes of the tree are not searched.

To search collapsed nodes, use the dot (.) or Control + dot (CTRL+.) keys preceded by the node name. The node is expanded and the search is limited to the children. For example, as shown below, entering texteditframe.jb in the structure pane selects the first jButton component in the TextEditFrame branch.

Searching trees

Normally, entries beginning with the specified text are selected. Use wildcard characters to change this behavior:



Editor

The JBuilder editor is accessed by clicking the Source tab in the content pane on an open text-based file. To open a file in the content pane, double-click it in the project pane, or select it and press Enter. Note the file status bar at the bottom of the editor which indicates the file name, the cursor location (line number and column), and the insertion mode or the size of an image file.

Editor

The editor offers a variety of productivity features, such as brace matching, syntax highlighting, keyboard shortcuts, customizable editor keymappings, CodeInsight, code templates, searching, and printing, as well as a fully customizable editor. Many of these features can be set in the Editor Options dialog box (Tools|Editor Options).

See also:
"Quick Tips" (Help|Quick Tips)
"Customizing the editor"
"Coding Shortcuts"
Help|Keyboard Mappings

Customizing editor keymapping

JBuilder's editor offers four customizable editor keymappings: You can change the default CUA editor in the Editor Options (Tools|Editor Options|Editor) or the IDE Options (Tools|IDE Options|Browser) dialog boxes. Select the Customize button to access the Keymap Editor where you can customize the keymapping.

Splitting the source view

The editor lets you split the source view of a file into two or more vertical or horizontal panes. This setting applies to an individual file, not to all the opened files in the content pane. You can have a different configuration for every opened file.

To split the view, right-click in the editor and choose either Split Vertically or Split Horizontally. Note that many other menu items are also available from this pop-up menu. To return a split view to one pane, right-click in each pane and choose Close View.

Editor

Using Browse Symbol in the editor

Browse Symbol, available on the right-click menu in the editor, is a powerful editor feature that allows you to browse such symbols as:

In order for a class to be found automatically, it must be on the import path. Results are displayed in the content pane of the AppBrowser.

You can also browse classes in the editor from the Search menu (Search|Browse Classes).

Finding text in the editor

The editor provides numerous ways to find and replace specific text in a file. Search commands are located on the Search menu. You can also modify the search options on the Editor page of the Editor Options dialog box (Tools|Editor Options|Editor).

Commands for finding text

Task Command
Find text Search|Find
Search for text across all files in selected path(s) Search|Find in Path
Find text and replace it with new string Search|Replace
Search for the same text again Search|Search Again
Search for text incrementally, as you type in the search string Search|Incremental Search
Go to a specific line number Search|Go To Line
Browse through a class, interface, or package Search|Browse Classes
Navigate to a specific item in the history list Search|History
Navigate to the previous item in the history list Search|Back
Navigate to the next item in the history list Search|Forward
Set bookmarks and return to them Key combinations listed in the keymap file (Help|Keyboard Mapping)

See also: Help|Keyboard Mapping for keyboard shortcuts by editor

Using todo tags in the editor

JavaDoc @todo tags are useful tags for adding reminders that work needs to be done to an area of code. These tags are placed inside JavaDoc comments, source code documentation comments. These @todo tags appear in JBuilder's structure pane in a To Do folder in JBuilder Professional and Enterprise.

JBuilder's code templates make adding @todo tags to your code very easy. Enter Ctrl+J in the editor to access the code template pop-up window and type todo. Then press Enter to expand the template in your code.

Your code could look something like this:

/** 
 * @todo Add your reminder or comment here
 */
Some of JBuilder's wizards generate @todo tags as reminders to add code to the stub code the wizard generates.

See also: Sun's Javadoc tool home page at http://java.sun.com/products/jdk/javadoc/index.html

Printing support in the editor

You can use the File|Print command to print your source code directly from the editor.

The File|Page Layout command displays the Page Layout dialog box, where you can set layout options:

Coding shortcuts

JBuilder features CodeInsight for assisting in code completion and code templates for quickly inserting frequently used code elements.

CodeInsight

CodeInsight provides code completion, parameter lists, and tool tip expression evaluation. JBuilder's CodeInsight displays context-sensitive pop-up windows within the editor that show the following:

Important: The project must be compiled before imported classes are available to CodeInsight.

CodeInsight pop-up window

To access CodeInsight, use the following shortcut keys. Keystrokes may vary by editor. See Help|Keyboard Mappings.

CodeInsight shortcut keys

Pop-up window Keystrokes Actions
MemberInsight Ctrl + Space or Ctrl + h Displays methods and members of current scope
ParameterInsight Ctrl + Shift + Space or Ctrl + Shift + h Displays method parameters
SymbolInsight Ctrl + Enter or Alt + Shift + h Drills down
ClassInsight Ctrl + Alt + Space or Ctrl + Alt+ h Displays Class Browser
Code templates Ctrl + j Displays code templates

You can configure these keystrokes, as well as other CodeInsight options on the CodeInsight page of the Editor Options dialog box (Tools|Editor Options).

See also: "Customizing the editor."

Tip: If CodeInsight fails, look for such errors as missing braces or import statements.

To commit a CodeInsight selection, press Enter or any symbol character, such as: ( (left-facing parenthesis), ) (right-facing parenthesis), + (plus sign), - (minus sign), or the space bar.

Note: CodeInsight is for Java files only.

MemberInsight

MemberInsight provides a pop-up list of all appropriate method calls for any given reference prefix. The pop-up list appears automatically when you type a dot character (.) in a valid context. You can also invoke the list manually by typing Ctrl+Space or Ctrl+h. 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. CodeInsight also has automatic code completion. If the remainder of the code statement is unique, CodeInsight automatically fills in the the rest of the code and the member list does not appear.

The member list is based on the current project's imports. Any deprecated methods are highlighted using strike-out. The list is also filtered based on the accessibility rules of the Java language.

ClassInsight

ClassInsight invokes the Class Browser dialog box which lists all available packages in a tree view. To display the browser, press Ctrl+Alt+h or Ctrl+Alt+Space when you are editing source code.

When the browser is displayed, choose the name of the class you want to insert in your code and press Enter or double-click. In addition to the navigational keystrokes, you can type alphanumeric characters to search the tree, or the dot (.) key to navigate into a package.

When you add a class using ClassInsight, the import statement is automatically added to your code.

ParameterInsight

When you are coding a method call, you can display a list of expected parameters for the method. To display the parameter list, type a method name and press Ctrl+Shift+Space, Ctrl+Shift+h, or the open parenthesis character ((). All possible parameters are displayed, including overloaded ones.

If the source code of the method is available, the parameter names are shown. As you fill in the parameters for the method call, the current parameter is highlighted in the parameter list.

SymbolInsight (Drill Down)

SymbolInsight quickly takes you to the source code for the current variable, method, or class name in the editor if it exists. If it's not available, it takes you to the stub source. To invoke this feature, place the cursor on the symbol in your source code and press Ctrl+Enter or Alt+Shift+. (dot).

Tool tip expression evaluation

This is a feature of JBuilder Professional and Enterprise.
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 pop-up window that looks like a tool tip.

ExpressionInsight

This is a feature of JBuilder Professional and Enterprise.
When the debugger is suspended, you can access ExpressionInsight - a small, pop-up window that shows, in tree form, the contents of the selected expression.

See also: "Debugging Java programs"

Configuring CodeInsight

To configure CodeInsight, right-click in the source pane, select Editor Options, and click the CodeInsight page (or choose Tools|Editor Options|CodeInsight). For more information, see CodeInsight in the topic "Customizing the editor." JBuilder provides several pre-defined code templates. Select Tools|Editor Options|Templates to view the available templates.

Code templates

Adding, editing, and deleting templates are features of JBuilder Professional and Enterprise. Code templates are read-only in Foundation.
Code templates are snippets of frequently used code elements that you can insert into your code to save repetitive typing. You can use code templates in the editor to speed up the coding process.

To use a code template in your code, select one of these methods:

The editor automatically expands the template.

JBuilder's pre-defined code templates are formatted according to your project preferences. These options are set in the following locations:

Editing code templates

This is a feature of JBuilder Professional and Enterprise.
You can edit JBuilder's default templates, create new ones, or delete any you don't need. To edit this list, right-click in the editor, select Editor Options, and click the Templates tab.

To create a new code template,

  1. Choose Tools|Editor Options and click the Templates tab.
  2. Press the Add button on the Templates page.
  3. Enter the name and description of the new code template, then press OK.
  4. Type the code for the new template in the Code text editing area.
  5. Add or edit other templates, then press OK when you are finished to close the Editor Options dialog box.

To edit an existing code template,

  1. Choose Tools|Editor Options and click the Templates tab.
  2. Use the mouse or the Up/Down arrow keys in the code template list to select the one you want to edit.
  3. Press the Edit button on the Templates page to change the name or description of the selected template.
  4. Enter the name and description of the new code template, then press OK.
  5. Type in the Code text editing area to modify the code sample.
  6. Add or edit other templates, then press OK when you are finished to close the Editor Options dialog box.

Important: When you create or modify templates, JBuilder does not format them according to the preferences. You must set the braces and indents manually.

For more information, see Templates in "Customizing the editor."


Working with the visual design tools

The JBuilder visual design tools consist of a component palette, an Inspector, several designers, and a component tree. To access the design tools, you must open a source file in the content pane, then click the Design tab. You can use the designer to visually design files that inherit java.awt.Container.

JBuilder in design view

JBuilder visual design tools

Three designers share the design surface on the Design page of the content pane: the UI designer, the menu designer, and the column designer.

The UI designer is used in assembling your visual UI components. When you first click the Design tab after opening a file in the content pane, JBuilder displays the UI designer by default. UI components appear in the UI folder of the component tree.

The menu designer is used to create menus. Menu components appear in the Menu folder of the component tree.

The column designer allows you to work visually with data set components. Data set components appear in the Data Access folder of the component tree. (The column designer is a feature of JBuilder Professional and Enterprise.)

See also:
Designing a user interface
Managing the component palette
Designing menus


Customizing JBuilder's IDE

Use the IDE Options dialog box to customize the JBuilder IDE (integrated development environment). To open this dialog box, choose Tools|IDE Options from the main menu.

The IDE Options dialog box contains the following pages:

Note: To return to the settings that were in effect when you brought up the dialog box, click the Reset button.

For information on modifying the editing environment, see "Customizing the editor."

Browser options

IDE Options - Browser

The Browser page of the IDE Options dialog box (Tools|IDE Options) controls the following:

Look And Feel
Sets the look and feel for the JBuilder IDE. Choose between Metal, CDE/Motif, or Windows look and feel.
Keymap
Sets the keymapping definitions for the editor to CUA (default), Emacs, Brief, or Visual Studio. For a complete listing of editor keymapping definitions, see Keyboard mapping definitions available on the Help menu.
Customize
Displays the Keymap Editor dialog box where you can customize your keymapping for the selected keymap.
Content pane tabs
You can alter the orientation and label type of the tabs in the content pane. Select from these options:

File Types options

Use the File Types page of the IDE Options dialog box (Tools|IDE Options) to customize the types of files the JBuilder editor recognizes.

To open the File Types page, choose Tools|IDE Options, then click the File Types tab.

IDE Options - File Types

The File Types page controls the following:

Recognized File Types
The list of file types that the JBuilder editor recognizes. When a file type is recognized, the JBuilder editor will open it.
Associated Extensions
The file extensions associated with the type of file selected in the Recognized File Types list.
Add
Displays the Input dialog box, where you add a file extension to the list of Associated Extensions for the selected type of file. Note that this does not add types of files to the Recognized File Type list.

Run/Debug options

Use the Run/Debug page of the IDE Options dialog box to customize the runtime and debug update intervals.

To open the Run/Debug page, choose Tools|IDE Options, then click the Run/Debug tab.

IDE Options - Run/Debug

The Run/Debug page controls the following:

Runtime Update Intervals
Sets the duration of runtime updates to the console.
Debugger Update Intervals
Sets the duration of debug updates to the console.

See also: "Customizing the debugger"


Customizing the editor

Use the Editor Options dialog box to customize the editing environment in JBuilder. To open this dialog box, choose Tools|Editor Options from the main menu or right-click in the source pane and select Editor Options.

The Editor Options dialog box contains the following pages:

Note: To return to the settings that were in effect when you brought up the dialog box, click the Reset button on the appropriate page.

For information on modifying JBuilder's IDE, see "Customizing JBuilder's IDE."

Editor options

Use the Editor page of the Editor Options dialog box to customize editing behavior.

Editor Options - Editor

Options on the Editor page include:

Keymap
Sets the keymapping definitions for the editor to CUA (default), Emacs, Brief, or Visual Studio. For a complete listing of editor keymapping definitions, see Keyboard mapping definitions available on the Help menu.
Customize
Displays the Keymap Editor dialog box for the selected editor where you can customize your keymapping for the selected keymap.
Block Indent
Specifies the number of spaces to indent a marked block. The default is 2; the upper limit is 16. If you enter a value greater than 16, you will receive an error.
Tab size
Sets the number of spaces separating each tab stop. The default is 8.
Backup Level
Specifies the number of file backups. The maximum number of backups is 30.
Smart Key Options
Determines how smart keys work in the editor. Click the   icon to expand the list.
Indent Options
Determines how indents work in the editor. Click the   icon to expand the list.
Display Options
Blink Caret sets the cursor to blinking or non-blinking. Click the   icon to expand the list.
Save Options
Determines how files are saved. Click the   icon to expand the list.
Search Options
Determines how files are searched. Click the   icon to expand the list.

Display options

Use the Display page of the Editor Options dialog box to select display and font options for the content pane. The Sample box displays the selected font.

Editor Options - Display

The Display page controls:

Visible Right Margin
Displays a thin, vertical gray line at the right margin of the editor.
Right Margin
Sets the right margin of the editor. The default is 80 characters. The valid range is 1 to 1024. If Visible Right Margin is selected, a thin, gray vertical line is displayed in the editor.
Editor Font
Selects a font type from the available screen fonts installed on your system (shown in the list). The editor displays and uses only monospaced screen fonts. Sample text is displayed in the Sample box.
Font Size
Selects a font size from the pre-defined font sizes associated with the font you selected in the Editor Font list box. Sample text is displayed in the Sample box.
Sample
Displays a sample of the selected editor font and size.

Color options

Use the Color page of the Editor Options dialog box to specify how the different elements of your code appear in the editor. You can specify foreground and background colors for anything listed in the Screen Element list. The editor supports syntax highlighting for Java, HTML, JSP, C, C++, SQL, XML, XSL, and IDL.

The sample code at the bottom of the dialog box shows how your settings will appear in the editor.

Editor Options - Color

The options on the Color page set the following:

Editor Color Scheme
Quickly configures the editor display using predefined color combinations.
Screen Element
Specifies syntax highlighting for a particular code element. You can choose from the Screen Element list or click the element in the sample box.
Attributes
Specifies format attributes for some of the code element selected in the Screen Elements list.
Foreground
Sets the foreground color for the selected code element. To set the color, choose a color from the Foreground palette. The selected color is displayed above the Foreground palette. Choose Use Default to restore the selected code element to its default foreground system color.
Background
Sets the background color for the selected code element. To set the color, choose a color from the palette. The selected color is displayed above the Background palette. Choose Use Default to restore the selected code element to its default background system color.
Sample code
Displays selected settings.

CodeInsight options

Use the CodeInsight page of the Editor Options dialog box to configure CodeInsight. The CodeInsight page is where you:

To open the CodeInsight page, choose Tools|Editor Options, then click the CodeInsight tab. You can also right-click in the editor and select Editor Options.

Editor Options - CodeInsight

If the Auto Popup options on this page are selected, the pop-up windows display after you enter the required activation characters (detailed below) on the keyboard and pause for the delay specified in the Delay slider bar.

If the Auto Popup options on this page are not selected, CodeInsight is available on demand by pressing shortcut keys. These keystrokes vary by editor keymappings selected on the Editor page of the Editor Options dialog box. See Help|Keyboard Mappings for a complete list of keymappings.

General options

Show Error Messages
If this option is on and the MemberInsight or ParameterInsight pop-up cannot be displayed due to compiler errors, CodeInsight expands the error node in the structure pane to display the errors. Also, in some cases, when there is additional information, the main status bar shows short message, such as "Unable to determine type of expression."

MemberInsight

These options control how CodeInsight displays MemberInsight, the list of accessible methods and data members for the current context.
Auto Pop-up MemberInsight
Causes the MemberInsight window to automatically pop-up in the editor after you type the activation character and pause for the delay specified with the Delay slider bar. The Delay slider bar sets the duration of the pause before the member prefix is parsed.
The activation characters for MemberInsight are:
  • . (dot)
  •   (blank space) if following an import string
Auto Complete On Invocation
When you invoke MemberInsight, if there is only one possible match in the list, it is automatically accepted and entered into the code. The pop-up list won't appear. You do not have to press Enter to commit the selection. To turn off this feature, uncheck the Auto Complete On Invocation checkbox.
Auto Complete While Typing
When this option is selected, the code is completed for you automatically as soon as a match is reached. This feature is off by default. If the Auto Pop-up MemberInsight option is off, this option is also off.
Include Classes
Displays class names in the MemberInsight window.
Include Deprecated Members
Determines whether deprecated methods appear in the list.
Show Class Context
Displays class name at the top of the pop-up window.

ParameterInsight

These options control how CodeInsight displays ParameterInsight, the list of parameters expected for the current method being coded.
Auto Pop-up ParameterInsight
Causes the ParameterInsight window to automatically pop up in the editor after you type the activation character and pause for the delay specified with the Delay slider bar. The Delay slider bar sets the duration of the pause before the member prefix is parsed.
The activation character for ParameterInsight is ( (left-facing parenthesis).
Include Deprecated Methods
Determines whether deprecated methods are shown in the ParameterInsight window.
Show Class Context
Displays class name at the top of the pop-up window.

Keystrokes

To customize the CodeInsight keystrokes, press the Keystrokes button on the Editor Options|CodeInsight page to open the CodeInsight Keystrokes dialog box.

CodeInsight Keystroke page

Type or double-click in a field to edit the keystroke combinations. Note that two keystrokes are available for each feature. If a keystroke is already assigned to the editor, it performs the editor action. Click the Default button to reset all the keystrokes to JBuilder default values.

CodeInsight display options

To customize the CodeInsight display, press the Display button on the Editor Options|CodeInsight page to open the CodeInsight Display Options dialog box. Display Options control the settings for CodeInsight features, including color, font, and font size.

MemberInsight page
The MemberInsight page configures how CodeInsight displays the list of accessible methods and data members for the current context.

MemberInsight Display Options

MemberInsight has the following settings:

Show Entry Types As Icons
Displays the type of accessible data member as an icon.
Use Strike-through For Deprecated Members
Strikes through data members or methods that have been deprecated. Note that deprecated members appear only if the the Show Deprecated Members checkbox has been selected on the Tools|Editor Options|CodeInsight page.
Use Custom Font And Colors
Allows you to set custom font and colors for the display.
Font Family
The font in which to display entries in the MemberInsight window.
Font Size
The text point size.
Foreground
The color of the text.
Background
The color of the background.
Selected Foreground
The color of the text for the selected entry in the MemberInsight window.
Selected Background
The color of the background for the selected entry in the MemberInsight window.
Sample
Displays selected settings.

ParameterInsight page
The ParameterInsight page configures how CodeInsight displays the list of parameters expected for the current method.

ParameterInsight Display Options

ParameterInsight page has the following settings:

Use Strike-through For Deprecated Methods
Strikes through data methods that have been deprecated. Note that deprecated methods appear only if the Include Deprecated Methods checkbox has been selected on the Tools|Editor Options|CodeInsight page.
Use Custom Font And Colors
Allows you to set custom font and colors for the display.
Font Family
The font in which to display the entries in the Parameter List window.
Font Size
The text point size.
Foreground
The color of the text.
Background
The color of the background.
Sample
Displays selected settings.

Templates options

Adding, editing, and deleting templates is a feature of JBuilder Professional and Enterprise. Code templates are read-only in JBuilder Foundation.
Use the Editor Options|Templates page to create and edit templates for individual code elements you frequently use.

Code Templates dialog box

The following explains the various parts of the Templates page:

Templates
The existing code templates. Choose a template to see its expansion in the Code box at the bottom of the dialog.
Code
The code in the template.

If you want the cursor to be on a new line after the last line of the expanded code, you must explicitly enter the newline character at the end of the template.

Use the pipe character, (|) to denote the caret position after the template is expanded. Use '\|' to enter a literal pipe character.

In the following sample code template, the cursor moves between the parens when the template is expanded:

if (|) {
 
}
else {
	   
}

Add
Displays the Add Code Template dialog box where you enter the new code template name and description.

Add code template

When you add a new template, it inserts it in the Templates list in alphabetical order. Press OK to return to the Templates page. Type the code for the template in the Code text editing area, then press OK.

Important: When you create or modify templates, JBuilder does not format them according to the preferences. You must set the braces and indents manually.

Edit
Displays the Edit Code Template dialog box where you can edit the selected template name and description.

Edit code template

Press OK to return to the Templates page. Change the code for the template in the Code text editing area of the Templates page, then press OK to close the Editor Options dialog box.

Important: When you create or modify templates, JBuilder does not format them according to the preferences. You must set the braces and indents manually.

Delete
Deletes the selected template.

Java structure options

You can control the organization of your files in the structure pane by selecting the Java Structure page in the Editor Options dialog box.

Editor Options - Java structure

Check one of the following items:

Group by visibility
Groups the structure elements according to their visibility. All public elements are listed first, followed by all protected elements, and then all private elements.
Separate members and fields
Groups the structure elements so that the members are listed first followed by the fields. For a standard class, the class it extends appears first, followed by all constructors, then the methods, and finally the fields of the class.
Sort alphabetically
Sorts the structure elements in alphabetical order.

These menu options are not mutually exclusive, so you can choose any combination. If no options are selected, the structure elements are listed in the structure pane in the same order they appear in the source code.

Use the Parse Delay slider to specify how often you want JBuilder to parse your code and register a change to the structure pane.


Using the object gallery

The object gallery gives you access to wizards you can use to create skeletal instances of many objects.

Object gallery

To use a wizard in the object gallery, choose File|New to open the object gallery. Select a wizard icon then click OK. JBuilder opens the associated wizard and creates the skeletal code in a .java file which it adds to your project.

Wizards that are grayed out in the object gallery are disabled. Some wizards only become enabled after creating or opening a project or a specific type of file. Wizards vary by JBuilder edition.


Using wizards to get a quick start

JBuilder wizards save you time by automatically generating code for you. You can access these wizards from several menus:

The following tables provide a description of each of the JBuilder wizards. For more information on a specific wizard, open the wizard and click the Help button or press F1.

Object gallery/New page (File|New)

Wizard Edition * Description
Project All Creates a new project.
Application All Creates a new Java application shell which contains a Frame.
Applet All Creates a minimal applet and an HTML file which contains the applet.
Servlet PRO, ENT Creates the required files for a blank Java servlet.
JavaServer Page ENT Creates the required files for a blank JavaServer page.
Archive Builder PRO, ENT Creates a .jar or .zip archive file of all the specified project files and their dependencies.
Class All Creates a new class shell in your project.
Interface PRO, ENT Creates a new interface.
JavaBean PRO, ENT Creates a JavaBean ready for you to customize with BeansExpress.
Dialog PRO, ENT Creates a new dialog class in your project.
Frame PRO, ENT Creates a new frame class in your project.
Panel PRO, ENT Creates a new panel class in your project.
Data Module PRO, ENT Creates a new data module, a file where you place all nonvisual data connection components.
Data Module Application PRO, ENT Creates a two-tier application from a data module (creates both client and server of a database application without CORBA).


Object gallery/Enterprise page (File|New)

Wizard Edition * Description
Sample IDL ENT Creates a simple IDL file in your project.
EmptyEJB Group ENT Creates a new EJB group to which you can add your enterprise beans. An EJB group is a logical grouping of enterprise beans that you are planning to deploy in a single .jar file.
EJB Group From Descriptors ENT Creates an EJB group that contains the deployment descriptors of existing enterprise beans.
Enterprise JavaBean ENT Creates an Enterprise JavaBean component.
EJB Entity Bean Modeler ENT Creates one or more entity enterprise beans from existing database tables.
EJB Test Client ENT Creates a simple client application for testing the functioning of an enterprise bean.
CORBA Client Interface ENT Creates a Java CORBA client that accesses a specified CORBA server interface.
CORBA Server Interface ENT Creates a CORBA Server Interface object from an IDL file.
HTML CORBA Client ENT Creates a HTML CORBA Client application from an IDL file.
CORBA Server Interface ENT Creates a CORBA Server application from an IDL file.


Wizards menu

Wizard Edition * Description
Implement Interface PRO, ENT Creates skeletal code that tells other objects that the selected class can be accessed via a certain Java interface.
Override Methods PRO, ENT Creates skeletal code to override a method in a superclass.
Archive Builder PRO, ENT Creates a .jar or .zip archive file of all the specified project files and their dependencies.
EJB Interfaces ENT Creates both a home and remote interface for an existing enterprise bean class. If you already have both a home and remote interface for your bean, the EJB Interfaces wizard will create new ones, overwriting your existing interfaces.
Use EJB Test Client ENT Defines an instance of a specified test client in the active class in the code editor.
Use DataModule PRO, ENT Uses an existing DataModule component.
Use CORBA Interface ENT Users/creates a CORBA server interface.
Resource Strings PRO, ENT Creates a Resource Bundle file for localization.

Tools menu

Wizard Edition * Description
New Library wizard All Sets up a new library. Select Tools|Configure Libraries and press the New button to open the New Library wizard.
New JDK wizard PRO, ENT Sets up a new JDK. Select Tools|Configure JDKs and press the New button to open the New JDK wizard.

Key:  All = All JBuilder editions
PRO = JBuilder Professional edition
ENT = JBuilder Enterprise edition


Creating JavaBeans the easy way

This feature is read-only in JBuilder Foundation.
JBuilder's BeansExpress makes it easy for you to create properties and events for a JavaBean, create property editors, and expose and edit properties. BeansExpress is accessible from the Bean tab on the lower left side of the content pane.

BeansExpress is the fastest way to create JavaBeans. It consists of a set of wizards, visual designers, and code samples that help you build JavaBeans rapidly and easily. Once you have a JavaBean, you can use BeansExpress to make changes to it. Or you can take an existing Java class and turn it into a JavaBean.

To begin creating a JavaBean using BeansExpress,

  1. Choose File|New Project and create a new project with the Project wizard.
  2. Choose File|New to display the object gallery.
  3. Double-click the JavaBean icon to open the JavaBean wizard.

    JavaBean wizard

  4. Specify the package you want the bean to be part of in the first text field. By default, this will be the name of your current project.
  5. Give your bean a name in the second text field.
  6. Choose a class to extend in the Base Class field.
    Either use the drop-down list, or click the ellipsis button (...) to display the Package browser and use it to specify any existing Java class you want.
  7. Choose the remaining options you want; none of them are required:
  8. Choose OK to close the JavaBean wizard.
For more information, see "Creating JavaBeans with Beans Express" in Building Applications with JBuilder.