TextFieldTest
Prerequisites
In this exercise, you will write an applet that creates and displays a TextField component. A TextField is a component that holds a single line of text. It differs from a Label component in that the Label component statically displays a string with no user interaction, whereas the TextField component allows the user to modify and interact with its contents.
Perform the following tasks:
Create an applet called TextFieldTest and add a new instance of the TextField class to the applet.
Define the method action so that when the user presses return inside the text field, the enclosed text is sent to System.out.
The task numbers above are linked to the
step-by-step help page. Also available
is a complete solution that meets
these requirements.
Related Exercises
|