Check09E (TS = 40)

Download the jar file typex.jar (the file has been updated on November 20, 20:30) and save it in the same directory as type.jar. typex.jar should already be part of your CLASSPATH.

Create the program named Check09E that prompts the user by printing

Enter name of file with serialized container: 
The file name should be entered on the same line (see sample run below). You may assume that the user always enters the name of an existing file. You may also assume that the file contains a serialized Container object. What a serialized object is and how it can be read can be found in Section 9.3.2 of the textbook. A sample file can be found here. A Container is often used for graphical user interfaces and contains Components. We are in particular interested in the following Components: Buttons, Checkboxes, and Labels. Your program should print for each Button and Checkbox of the Container its label and for each Label of the Container its text.

Here is a sample run (where the user has entered container.ser)

Enter name of file with serialized container: container.ser
A label with text Label1
A checkbox with label Checkbox5
A button with label Button2
A checkbox with label Checkbox2
A button with label Button1
A label with text Label0
A button with label Button3
A checkbox with label Checkbox0
A checkbox with label Checkbox4
A checkbox with label Checkbox3
A button with label Button5
A button with label Button0
A button with label Button4
A checkbox with label Checkbox1
A checkbox with label Checkbox6

To check whether your code is correct, you can use eCheck. You are advised to use the offline mode first. Once your code is correct (worth 3 marks) and you are happy with your style (worth 2 marks), you can switch to the online mode and submit your solution. For style, you should adhere to the code conventions described in Appendix C of the textbook.