To practice using JTables
Instructions
For this lab you will need to create a Java Application that allows a user to manage questions and answers. The application should make use of at least two JTables, one for displaying a list of questions which are stored in a questions data file, and another for showing answers which are stored in an answers data file (sample files available below).
The fields stored about a question are:
- The Question's ID number
- The Question's text (the question itself)
- The Question's Asker (the person who asked the question, basically their name)
- The Number of Times the Question has been viewed
The application should allow the user to view, edit, add, and remove questions from the file as well as providing some way to keep track of the number of times the question has been viewed indicating the questions popularity.
The application should also make the answers to each question available to the user in some way that makes it clear to the user which answers belong to which questions.
The fields stored about an answer are:
- The Answer's ID
- The Answer's Question ID (the ID number of the question this answer belongs to)
- The Answer's text (the answer itself)
- The person who answered the question (who this answer was provided by)
- The Answer's popularity
The application should allow the user to view the answers for a specific question and should allow the user to add new answers, remove answers, edit answers, and indicate the popularity of an answer.