3) Object Browser
If you select a control on the user interface designer, the Object Browser will appear in the lower right corner. Object browsers play an important role in program development and are the basis for visual programming. The Object Browser is mainly used to provide users with access to properties in the object's claim section, such as reading and modifying. At the same time, the Object Browser also provides settings for Object events. In these settings, you can often complete tasks that require a lot of work in the object-oriented technology, even these jobs that change attributes and events are all about programming. This greatly increases code reusability, which is the advantage of object-oriented technology.
4) User Interface Designer
As the user's requirements for the interface are gradually improved, the current visual programming has replaced the traditional user interface design method. In visual programming, the direct connection between humans and machines is mainly achieved through some windows and dialog boxes. Jbuilder9 is no exception. It also uses these windows and dialog boxes to implement forms. The controls you need can be directly placed on the form to implement complex functions.
The user interface designer is the most commonly used tool in programming. When you design the interface, you only need to click the design page in the file view label to see the user interface designer. You can use various controls provided by JBuilder to build your own program interface. In addition, jbuilder9 also automatically generates corresponding code for these interfaces, providing users with a program environment. Next, you need to set attributes to write code that implements specific user functions. This greatly reduces the complexity of the user interface design, allowing the user to focus on how to implement and enhance functions.
5) Source Code Editor
As long as you write the relevant program, you need the corresponding program editor. jbuilder9 also provides such an editor. During program design, you only need to click the source page in the file view label, the source code editor will appear. You can use it to edit the JBuilder program.
For the source code editor, you can also set it based on your preferences and habits. You can click tools> ide options to display the IDE Options dialog box, in this dialog box, you can set the window size, font size, and other information. You can set the editor, display, color, code preview, template, Java structure, and other content on the tab opened by tools> editor options. For example, you can set your favorite editing and display template. Using Code profiling can also speed up programming. Jbuilder9 has been predefined for code templates, including class declarations, if statements, if else statements, try/catch statements, while statements, and other templates.
In the program code editor, if you want to get help, just move your mouse over the keywords, objects, or other tags you want to query, and then press the F1 key, you can get the corresponding help. When you create an application, JBuilder 9 creates a unit of file frame1.java for the main form in the code editor.
To access other files in the source code editor, click the corresponding file in the project window. If an error occurs during program compilation, in addition to displaying the error message in the message box window, the error line is highlighted in the source code editor. You can quickly locate the methods, attributes, and events to be searched in the source code editor. In addition, bidirectional design tools support code modification in the visual editor and can be reflected in the design view.
The Code preview function (codeinsight) of jbuilder9 can display a context-related pop-up window in the editor. It helps you quickly and accurately write Java code. For example, if you click an object and all its attributes and methods are immediately displayed at the corresponding position, you can quickly select the desired content. The Code preview function allows you to display the data member and method list (memberinsight) related to the context and the parameterinsight parameter list of the methods to be used in the current Code), the list of classes (classinsight) that can be accessed through the current class path, the error (errorinsight) in the structure window, and the variable value and expression value displayed during debugging.
6) Check and debug errors
In jbuilder9, you can use the red dot in the editor to display the code errors of the current row, but not the logic errors and running errors, therefore, we also need to know how to check and debug errors to eliminate logic and runtime errors.
First, you must set the breakpoint. The method is very simple. If you click the mouse in front of any row of statements in the editor, the row is automatically set as a breakpoint. The above breakpoint is only the simplest line breakpoint. In fact, there are other types of breakpoints. There are five types of breakpoints: line, exception, class, method, and cross-process. For more information, see help.
You can also select debug from the run menu to enter the debugging interface of the program using the project menu that shows errors in blue. When you debug and run a program, the system displays the error (text in red), including the name and line of the program. Click this part and the file will be cut in the editor, the program lines with errors are highlighted. When you need to observe an object, you must first add the object to be observed by clicking the Add watch menu item in the run menu and then finding the breakpoint of the object, run the debug project to enter the debugging status.
4. Use JBuilder 9 to develop a simple application
The general process of programming in JBuilder 9 includes the following four steps:
(1) create a project file.
(2) Use the Wizard to generate the program framework and interface.
(3) manually modify the program code.
(4) Compile and run the program.
Here we only introduce the "Automatic" method for generating programs, and do not manually modify the program code. After learning about the integrated development environment, we can now use the Application Wizard provided by jbuilder9 to design the application. The following describes the development process of the jbuilder9 application by taking the construction of a simple framework application as an example.
1. Use proioct Wizard to create a project
You can use Project Wizard of jbuilder9 to create a project. The project name is example. JPX. The project file contains the directory information of other files in the project. Follow these steps to create a project using Project Wizard.
(1) Select File> New Proiect menu, and the dialog box 19 is displayed.
(2) In the Name text box, enter example. Use the default value for other options.
(3) Click the next button to enter the dialog box 20 shown.
(4) Keep the default settings and click Next To Go To The dialog box 21 shown.
(5) Enter example in the title and Related Description and author.
(6) Click Finish to complete the project settings. JBuilder will automatically generate the project example.
2. Use Application Wizard to create an application
You can use Application Wizard to create a Java application. The procedure is as follows.
(1) Select File> New to display the object gallery dialog box. 22. The dialog box provides a wizard for creating different files.
(2) Click the application icon. The Application Wizard dialog box is displayed, as shown in Figure 23. Keep the default settings and click Next to go to step 2 of the Application Wizard.
(3) 24. Enter frame1 in the class text box and example in the title text box.
(4) Select the center frame on screen check box to enable the application to run in the center of the screen. Click the next button to go to step 3 and 25 of the Application Wizard.
(5) Keep the default settings. Click Finish to complete the Java application settings. The system will automatically create example. after the Java and frame1.java programs are added to the project, the source program corresponding to the application interface is automatically generated.
Click frame1.java and example. Java to view the source code, as shown in Figure 26.
Select the Run-> RUN project menu item or press the shortcut key F9 to run the application. Result 27 is displayed.