CHAPTER 10 - LightBulb program. 10.5. Draw the containment...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Java Software Solutions, 4e Lewis/Loftus Chapter 10 Chapter 10 Exercise Solutions 10.1. Create a UML class diagram for the ProductCodes program. 10.2. What would happen if the try statement were removed from the level1 method of the ExceptionScope class in the Propagation program? If the try statement were removed from the level1 method of the ExceptionScope class in the Propagation program, the ArithmeticException problem would be propagated to the main method (which called the level1 method). Since there is no try statement in the main method, the program terminates, producing an exception message. 10.3. What would happen if the try statement described in the previous exercise were moved to the level2 method? If the try statement were moved from the level1 method to the level2 method (and the call to level2() were changed to a call to level3()), the exception would be caught and handled in the level2 method.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Java Software Solutions, 4e Lewis/Loftus Chapter 10 10.4. Draw the containment hierarchy for the
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: LightBulb program. 10.5. Draw the containment hierarchy for the PickImage program. 10.6. Draw the containment hierarchy tree for the JukeBox program. Java Software Solutions, 4e Lewis/Loftus Chapter 10 JFrame RigidArea (0,5) JLabel Title Label JComboBox Music Selection RigidArea (0,5) RigidArea (0,10) RigidArea (0,10) JukeBoxControls Entire Interface (Vertical Box Layout) JPanel Button Panel (Horizontal BoxLayout) JButton RigidArea (5, 0) JButton Java Software Solutions, 4e Lewis/Loftus Chapter 10 10.7. What effect would removing the call to setSelectionMode in the ListPanel class have? Make the change to test your answer. The call to the ListSelectionMode method uses the constant SINGLE_SELECTION to set the selection mode explicitly. If this call were removed and a default constant allowed for multiple selections, the getSelectedValue method would return the first item selected. The image corresponding to the first selected item would be the image displayed....
View Full Document

Page1 / 4

CHAPTER 10 - LightBulb program. 10.5. Draw the containment...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online