The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
The Flora program needs to generate sev- eral message boxes for the user, but calls a programmer-supplied MessageBox class rather than using JOptionPane. You have been asked to update the Flora program to use appropriate JOptionPane boxes.Â
Perform the following steps.
1. Start TextPad and open the file named MessageBox. Print a copy for your reference.
2. Compile the MessageBox file.
3. Open the file named Flora. Print a copy for your reference.
4. Compile and run the Flora program.
5. Try entering data appropriately, then try omitting data fields. Notice when the message boxes are displayed. Close the program.
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. 1
Attachments: