2-Alternately, you can add components by first selecting an icon in the Component Palette and then selecting the node for the UI (labeled this for the frame you are creating) in the Structure window. This method can be a more accurate way of creating a UI since not all components are visible in the UI Editor.
3- Adjust the position and size of the combo box by clicking on it and dragging it until it resembles the target example shown in Step 5: Compiling and Running your Application. To alter the position of the combo box, grab it in the middle and drag it. To alter its size, click in it to display its grab bars, and then click on any grab bar to resize the box in either of the two directions shown by the cursor image.
4- Now you will add a text field to the frame. In the Component Palette, scroll to the right, select the JTextField icon , and then click in the frame.
5- Once the text field appears, adjust its position and size as you did with the combo box, again so that your frame begins to resemble the target example in Step 5: Compiling and Running your Application.
6- Now add a button to the UI. In the Component Palette, select JButton and then again click in the frame. As you did with the other two components, adjust the position of the button to match the target example.
7- Next you will create a label for the combo box. Select JLabel and then click in the frame.
8- With the new JLabel selected in the frame, turn to the Property Inspector and, with the Properties tab selected, change the text for the label to Select Status Code: To enter text for the label, type into the field to the right of the text property.
9- Now adjust the size and position of the label in the frame so that it is displayed to the left of the combo box.
10- Repeat these last two steps to create a label for the text field, but this time change the text property to Status Result:
11- Now you will change the text for the button, but this time directly in the code. Bring the Code Editor for Frame1.java to the foreground, this time by clicking in the document bar, just above the Navigator. With the document bar, you can quickly and easily navigate among all the currently open instances of files in the editor. To open the document bar explicitly, or to close it, from the main menu choose View | Document Bar. The Code Editor view for Frame1.java is marked with the number 2 because in this tutorial, it was opened second.
12- In the Code Editor, locate the following line:
jButton1.setText("jButton1");
Change jButton1 to OK.
To find the line quickly, you can search incrementally forward or backward. Place your cursor in the Code Editor and from the main menu, choose Search | Incremental Search Forward or Search | Incremental Search Backward. In the search box that appears, type in the search string. As you type, the cursor jumps to the next instance of the text that currently appears in the search box. The search is case sensitive. Return to the UI Editor and note that the text on the button in the frame has changed to OK.