Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Lab 9: More GUI programs: Support Ticket Application This program adds a GUI to the command line Support Ticket application from a previous lab. This
Lab 9: More GUI programs: Support Ticket Application This program adds a GUI to the command line Support Ticket application from a previous lab. This program is a prototype to manage IT support tickets for a company. Users will call or email a helpdesk to report computer problems. The technician will enter the information into this program, which will keep a record of all current problems. The tickets are assigned a priority between 1-5. Tickets need to store the priority, a description of the Task, the person who reported it, and a ticket ID number. 1 is the most urgent (e.g. all servers down); 5 is the least urgent (e.g. missing mouse mat). When a Ticket is resolved (fixed or become non-issue), the ticket is deleted and the reason for deleting the ticket is recorded. Your Ticket objects should be able to store another date; `resolvedDate`, the date the ticket was closed. And, a String that documents why the ticket was closed the fix or the resolution for the ticket. This String should be called `resolution` For this lab, you will implement a GUI for the program.
### Task 2: Configure TicketGUI ticketList JList Configure `ticketList` so it will be able to display a list of Ticket objects. Use generic types. The Ticket objects should be shown in priority order, most urgent first. TicketStore should already be returning Ticket lists in the correct order. The selection model should be `SINGLE_SELECTION`. `ticketList` will be able to show any list of Tickets, for example, all the open Tickets, or only Tickets that match a search.
package week_9; import javax.swing.*; public class TicketGUI extends JFrame { // TODO complete the tasks described in grades/Lab 9 Questions.md protected JPanel mainPanel; // Components for adding tickets protected JPanel addTicketPanel; protected JTextField descriptionTextField; protected JTextField reporterTextField; protected JComboBox priorityComboBox; protected JButton addButton; // Components for displaying ticket list protected JPanel ticketListPanel; protected JListticketList; protected JLabel ticketListStatusDescription; // Components for searching protected JPanel searchPanel; protected JTextField descriptionSearchTextBox; protected JTextField idSearchTextBox; protected JButton searchDescriptionButton; protected JButton searchIdButton; protected JButton showAllTicketsButton; // Saving and quit protected JPanel controlsPanel; protected JButton saveAndQuitButton; // Deleting protected JButton deleteSelectedButton; // Messages for showing in ticketListStatusDescription // Use these instead of your own Strings, the tests expect you to use these variables static final String ALL_TICKETS = "Showing all tickets"; static final String TICKETS_MATCHING_DESCRIPTION = "Tickets matching search description"; static final String TICKET_MATCHING_ID = "Ticket matching ID"; static final String NO_TICKETS_FOUND = "No matching tickets"; static final String INVALID_TICKET_ID = "Invalid ticket ID"; // A reference to the SupportTicketManagerWithGUI object // The GUI will call the methods in this class to add, search for, and delete tickets. // See example in quitProgram method. TicketProgram manager; TicketGUI(TicketProgram manager) { this.manager = manager; setContentPane(mainPanel); pack(); setVisible(true); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); } // Call this method to quit the program. The tests expect you to use it. protected void quitProgram() { manager.quitProgram(); this.dispose(); } // Use this method to show message dialogs displaying the message given. // Otherwise tests for code that shows alert dialogs will time out and fail. protected void showMessageDialog(String message) { JOptionPane.showMessageDialog(this, message); } // Use this method to show input dialogs asking the given question. // Otherwise tests for code that shows input dialogs will time out and fail. // If user presses the cancel button, this method will return null. protected String showInputDialog(String question) { return JOptionPane.showInputDialog(this, question); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started