Write an application to make entries for the "Who wants to be a Millionaire?" game. The specification for the entry frame is given as a prototype, see Figure 1. The entry frame has three main components, the "Welcome" label, the question/answers panel and the buttons panel at the bottom.
Figure 1. Entry Frame for the questions.
The layout of the frame is defined within the attached java file. The functionality of each button is as follows:
Upon completion of an entry,
? If the <Add> button is pressed, then the data from the text fields and the radio button set is collected and used to create a new Question instance, then this question is added to the list(Vector) of questions. The fields are cleared.
? If the <Save> button is pressed, then all the data that was gathered within the list of questions(Vector) is written to a file. The fields are cleared. The list of questions are initialized to an empty list.
? If the <Read> button is pressed, then the list of questions is read from the file and used to set the data of the Vector.
The above scenario assumes the order of operation as <Add>?, <Save>, <Read>, <Next>?. If the user presses the <Save> before any <Add> happens, an empty Vector will be written to the file.
Project Part-I requires you to populate the saveQuestions() and readQuestions() methods.
Project Part-II requires you to add a <Next> button to the button panel with the following functionality:
? After a <Read> happens, if the <Next> button is pressed, then the next question in the Vector is displayed. You need to keep an index in order to remember the current position.
? Bonus: The <Next> button gets disabled when there are no elements in the Vector or if the end of Vector is reached.
The project should include:
i. Error checking. Currently if there is no selection for the entry, an exception will be thrown. (Hint: You can place error checking for the missing elements in the constructor of the Question or elsewhere.)Exceptions handling (file io).
ii. Full documentation using javadoc comments and the html files.
iii. You can populate any of the components with explanatory text and modify the attributes.
iv. No development environment tools are allowed. I do recognize the code generated by the IDE tools.