Java Reference
In-Depth Information
user's name
to display
here
applet
window
output is
displayed
graphic
system date
add color
to background
FIGURE 2-3b
When designing a console application, programmers typically use text to
display the output. Console applications are used when the program must dis-
play information such as prompts, simple menus, and input and output data. In
the Welcome to My Day application, the program requires no input from the
user, so no prompts for data input display. The program displays three lines of
output data as left-justified text. As shown in the storyboard in Figure 2-3a on
the previous page, the output text is displayed with a top and left margin to pro-
vide space between the window's edge and the output text. Design experts agree
that adding top and left margins makes the display look less crowded and creates
a more visually appealing display of output.
While the system date display may seem cryptic to those unfamiliar with
that sort of notation, the requirements document states that the employees are
accustomed to seeing the date display in that manner. When designing an appli-
cation, it is important to adhere to company standards and practices so as to
make users comfortable with the user interface.
The output for the applet will include the same text that the application
displays, as well as color and a graphic (Figure 2-3b). The smiley face graphic
used in this prototype applet is a placeholder graphic submitted with the
requirements document and included on the Data Disk that accompanies this
book. When the electronic calendar application is implemented, the graphic
would be replaced with a company logo.
The requirements document states that the user will click the Close button
to exit the program. Both Java console applications and applets automatically
display a standard Close button, which is a default or preset feature of the com-
mand prompt and Applet Viewer windows. When a user clicks the Close button,
the active window closes. The close action is encapsulated into the Click event of
the Close button — in other words, the operating system automatically tells the
Java program how to close the active window when a user clicks the Close but-
ton. In addition to the default Close button, the command prompt and Applet
Viewer windows also both include Minimize and Maximize buttons. When
developing a program, programmers can assume that those button objects and
their corresponding events will work as intended. No further design issues apply
to exiting the program.
 
Search WWH ::




Custom Search