Read the documentation for the
TextField class and
determine what events are sent when the user types, what kind of
listener can react to those events, and how the listener can react.
Write a short summary that your classmates should be able to understand
Using your answer from Problem G3-A, write a simple GUI that observes what the user types and capitalizes every letter typed.
Using your answer from Problem G3-A, write a simple GUI that reads in a password typed in a text field, putting some special symbol in the field in place of each character typed.
Java provides a
setSize method for text fields as well
as for other components. Read and report on the use and abuse of this
method. Can you use it to create a blank field, as we needed in
Build a new graphical user interface class,
which displays eleven buttons corresponding to the ten decimal digits
(0, 1, ..., 9) and clear. Your class should also display a field.
When the user clicks on a digit, you should add it to the end of the
Calculator class to support an
equals button. The
add button should remember the current value
in the display field and clear that field. The
button should add the contents of the display field and added it
to the remembered value. If this seems odd to you, consider the
interface for a typical desktop calculator.
Copyright (c) 1998 Samuel A. Rebelsky. All rights reserved.
Source text last modified Mon Oct 25 23:29:32 1999.
This page generated on Tue Oct 26 15:38:01 1999 by Siteweaver.
Contact our webmaster at email@example.com