Java Reference
In-Depth Information
6. Look through the source code for the Flora.java file. Insert comment marks
(//) at the beginning of all lines involving any of the message boxes, except
for the MessageBox declaration statements. Directly underneath the lines
that are commented out, insert new code to generate JOptionPane dialog
boxes that replace the message boxes. Use the same titles, prompts, and
buttons. Do not forget to import the necessary Swing packages.
7. Compile the Flora program again and fix errors if necessary.
8. Run the program and enter both appropriate and incorrect data. Try leaving
some fields blank.
9. If necessary, fix any logic errors and then repeat steps 7 and 8 until the
program runs correctly.
10. Print a copy of the updated Flora.java file for your instructor.
3 Converting Programs to Swing
Using the Flora program you updated in Programming Assignment 2, convert
the interface to a Swing interface with the Motif Look and Feel. Convert all of
the AWT components to Swing. Compile, debug, and run the program. Specifi-
cally, look at the changes in the dialog box. Print a copy of the updated Flora
program for your instructor.
4 Creating a Requirements Document
Using the Flora program updated in Programming Assignment 2 or 3, create the
requirements document that generated the production of the Flora program.
Use your name as the programmer and the current date as the date. A blank
requirements document, in Microsoft Word format, is located in the Chapter01
folder on your Data Files for Students disk. Include the purpose, necessary
algorithms, and any notes the programmer might need. Use Figure 8-2 on page
489 as a model.
5 Understanding
Layout Managers
Figure 8-37 displays a Java
program that creates a window
interface used by Ye Olde Ice
Cream Shoppe in order to fill
ice cream orders. Draw two
different storyboards to explain
how the layout managers might
have been subsetted in order to
achieve the components'
placement.
FIGURE 8-37
Search WWH ::




Custom Search