Java Reference
In-Depth Information
A second GUI
4
In this chapter we construct another graphical interface. The purpose of this one is
to pass text to a running application.
4.1
The specification of the application
The application is to perform an extremely simple text analysis. The appearance
and functionality of the GUI should look like Figure 4.1. To the right of the text
'Enter text:' is an editable area where the user can enter or change text. If one
clicks on the button 'Analyse' then a small analysis of the text is performed and
the result is displayed in the following way. The text is converted to capital letters
and copied into the area to the right of 'Current text:'. The number of occurrences
of the letter 'E' in upper or lower case is displayed to the right of 'No. of Es in
current text:'. At the same time the content of the user editable area is erased.
Frame
Title
Dannebrog
Enter text:
Editable
text area
Repetition of
text in upper
case
Current text:
DANNEBROG
No of Es in current text: 1
Number of
E in text
Analyse
Button
Fixed texts
Figure 4.1 The specification of the GUI for text analysis
Search WWH ::




Custom Search