Java Reference
In-Depth Information
HTML supports many of the same GUI components as Java but, unfortunately, has different names for many of
the components. A form is similar to a Java frame in that it is usually comprised of many GUI components. The two
major differences with a form are that a form must include a submit button and the form components are defined
before the form is defined.
Adding form components is similar to adding Java frame components: select the component then click on the
Web page location to paste it onto the page. However, a Web page is more text-oriented than a Java frame. The Web
page is more like a word processing document, so manipulation through click and drag is very limited. For instance,
to move a component lower on the Web page you must press the Enter key and insert blank lines.
Heck, let's get to it instead of talking about it.
5.
Make sure the Design view is selected and then type the text Employee Name.
6.
In the far right pane, change from the Outline view to the Palette view.
7.
Expand the Form Tags tray, click Text Field , and then click to the right of Employee
Name text.
The Insert Text Field window will be displayed. This is used to specify the text field attributes. Notice that a
default size (20) for the field is already specified. There is also a maximum length parameter that can be specified,
a password option (which means that entered text will not be displayed), and an initial value can be defined.
8.
Specify the Name as empNameTF and accept the other defaults by clicking the OK button.
Notice that a text field is inserted right next to the text.
9.
Press the left arrow key to move the cursor between the text and the text field.
10.
Press the spacebar once to insert a space.
Pressing the spacebar a second time will not insert another space.
11.
Click Insert , then Non-breaking Space to insert another space between the two
components.
The text field can be dragged to the next line by clicking on the border and dragging, but this is the extent of the
click and drag capability (at this time). There are also resize handles on the text field but they will only control the
field's length not its height.
12.
Change the text “Employee Name” to “Employee Number.”
13.
Display the text field's properties by right-clicking on the text field then select Properties.
14.
In the Properties view, change the field Name to empNumTF and the size (Columns) to 6.
15.
Select the text “Employee Number.”
Notice that the properties view now displays the text's properties.
16.
In the Properties view, click on the font tab (on the left side) and specify the font properties
as seen in Figure 8-22 .
 
Search WWH ::




Custom Search