Using BlueJ need help please!

Question: I’m currently using BlueJ for a school project and i’m having an issue where one of my grids on a scheduleappointment forms is not generating the date options and the listing tab is being updated can anyone help? my submission date is 2mor and i’m desparate for some help

Repl link/Link to where the bug appears:

Screenshots, links, or other helpful context:


/**
 * CreateAppointment.java
 * The CreateAppointment class register's a new Customer
 * 
 * @author (your name)
 * @version (a version number or a date)
 * @date (date)
 */

import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.text.MaskFormatter;
import java.sql.*;
import java.io.File;
import java.io.IOException;


public class CreateAppointment extends JFrame implements ActionListener {
    
    public static final int FROMLEFT = 230;
    public static final int FROMTOP = 50;
    public static final int WIDTH = 900;
    public static final int HEIGHT = 580;
    public static final int QUOTE = 0;
    public static String customerNo = "";
    public static String preparedByStaffNo = "";
    public static String assignedToStaffNo = "";
    public static String serviceNo = "";
    
    public static JTextField tappointmentTime, tservice, testimatedDuration, tcost, ttimesSchedule, tassignedTo;
    public static JComboBox tserviceType, tunitOfMeasureType;
    public static JTextArea tappointmentNotesPanel, tquoteNotes,tserviceNotes;
    
    JTextField tappointmentDate, tvalidDate;
    JTextArea tappointmentTimeName;
    JComboBox tstatus;
    JButton clear, submit, close, listCustomer, listService, listPreparedBy, listAssignedTo;

    //--------------------------------------------------------------------------
    //Create a DatabaseAccess object
    DatabaseAccess da = new DatabaseAccess();    
    
    
    //Constructor for objects of class CreateAppointment
    public CreateAppointment() {
    }
    
    
    //--------------------------------------------------------------------------
    public void CreateAppointment() {
        //Setting the Customer Form properties
        setTitle("Service Management: Create Appointment");
        setBounds(FROMLEFT, FROMTOP, WIDTH, HEIGHT); //size of the frame
        setResizable(false);
    
    
        //----------------------------------------------------------------------
        JMenuBar menuBar = new JMenuBar();
        JMenu menu1 = new JMenu("File");
        JMenu menu2 = new JMenu("Edit");
        JMenu menu3 = new JMenu("Help");
        
        menuBar.add(menu1);
        menuBar.add(menu2);
        menuBar.add(menu3);
        
        //----------------------------------------------------------------------
        //Service Main Body Panel: The middle component of the JFrame
        JPanel mainBodyPanel = new JPanel();
        mainBodyPanel.setSize(900,500);

        //----------------------------------------------------------------------
        //Service Sub Panel 1: The top label on the form
        JPanel mainBodySubPanel1 = new JPanel();
        mainBodySubPanel1.setLayout(null);
        mainBodySubPanel1.setBackground(Color.GREEN);
        mainBodySubPanel1.setPreferredSize(new Dimension(900, 40));
        
        //The title on the form to be placed in mainBodySubPanel1
        JLabel title = new JLabel("Create Appointment"); 
        title.setHorizontalAlignment(JLabel.CENTER);
        title.setVerticalAlignment(JLabel.CENTER);
        title.setFont(new Font("Arial", Font.BOLD, 20));
        title.setOpaque(true);
        title.setBackground(Color.WHITE);
        title.setForeground(Color.RED);
        title.setSize(900, 35); 
        mainBodySubPanel1.add(title);
        
        
        //----------------------------------------------------------------------
        //Service Sub Panel 2: Quote Data Sub Panel 2
        JPanel mainBodySubPanel2 = new JPanel();
        mainBodySubPanel2.setLayout(null);
        mainBodySubPanel2.setPreferredSize(new Dimension(850,130));
        mainBodySubPanel2.setBorder(BorderFactory.createTitledBorder("Appointment Information"));
        
        
        //----------------------------------------------------------------------------------------------
        //Quote Sub Panel 2: The Quote Date label on the form
        JLabel lappointmentDate = new JLabel("Appointment Date");
        lappointmentDate.setFont(new Font("Arial", Font.PLAIN, 14));
        lappointmentDate.setSize(120, 20);
        lappointmentDate.setLocation(20, 30);
        mainBodySubPanel2.add(lappointmentDate);
        
        //Quote Sub Panel 2: The Quote Date textbox on the form
        MaskFormatter appointmentDateMask = null;
        try {
          appointmentDateMask = new MaskFormatter("####-##-##"); //the # is for numeric values
          appointmentDateMask.setPlaceholderCharacter('-');
        } 
        catch (Exception e) {
          e.printStackTrace();
        } 
        
        tappointmentDate = new JFormattedTextField(appointmentDateMask);
        tappointmentDate.setFont(new Font("Arial", Font.PLAIN, 15));
        tappointmentDate.setSize(100, 20);
        tappointmentDate.setLocation(150, 30);
        mainBodySubPanel2.add(tappointmentDate);
        
        lappointmentDate = new JLabel("(yyyy-mm-dd)");
        lappointmentDate.setFont(new Font("Arial", Font.PLAIN, 14));
        lappointmentDate.setSize(120, 20);
        lappointmentDate.setLocation(270, 30);
        mainBodySubPanel2.add(lappointmentDate);
        
        
        //--------------------------------------------------------------------------------------------- 
        //Quote Sub Panel 2: The Customer label on the form
        JLabel lappointmentTime = new JLabel("Appointment Time"); 
        lappointmentTime.setFont(new Font("Arial", Font.PLAIN, 14)); 
        lappointmentTime.setSize(120, 20); 
        lappointmentTime.setLocation(20, 60);
        mainBodySubPanel2.add(lappointmentTime);
       
        //----------------------------------------------------------------------         
        //Quote Sub Panel 2: The Quote Date textbox on the form
        MaskFormatter appointmentTimeMask = null;
        try {
          appointmentTimeMask = new MaskFormatter("##:## LL"); //the # is for numeric values
          appointmentTimeMask.setPlaceholderCharacter('-');
        } 
        catch (Exception e) {
          e.printStackTrace();
        } 
                      
        tappointmentTime = new JFormattedTextField(appointmentTimeMask);
        tappointmentTime.setFont(new Font("Arial", Font.PLAIN, 14)); 
        tappointmentTime.setSize(100, 20);
        tappointmentTime.setLocation(150, 60);
        tappointmentDate.setNextFocusableComponent(tappointmentTime);
        mainBodySubPanel2.add(tappointmentTime);
        
        lappointmentTime = new JLabel("(hh:mm am/pm)");
        lappointmentTime.setFont(new Font("Arial", Font.PLAIN, 14));
        lappointmentTime.setSize(120, 20);
        lappointmentTime.setLocation(270, 60);
        mainBodySubPanel2.add(lappointmentTime);
        
        //--------------------------------------------------------------------------------------------- 
        //Quote Sub Panel 2: The Status label on the form
        
        
        //--------------------------------------------------------------------------------------------- 
        //Quote Sub Panel 2: The Prepared By label on the form
        JLabel ltimesSchedule = new JLabel("Times Schedule"); 
        ltimesSchedule.setFont(new Font("Arial", Font.PLAIN, 14)); 
        ltimesSchedule.setSize(120, 20); 
        ltimesSchedule.setLocation(470, 30); 
        mainBodySubPanel2.add(ltimesSchedule);
       
        ttimesSchedule = new JTextField();
        ttimesSchedule.setSize(210, 20);
        ttimesSchedule.setLocation(595, 30);
        tappointmentTime.setNextFocusableComponent(ttimesSchedule);
        mainBodySubPanel2.add(ttimesSchedule);
                      
        //------------------------------------------------
        //Service Sub Panel 3: Quote Data Sub Panel 3
        JPanel mainBodySubPanel3 = new JPanel();
        mainBodySubPanel3.setLayout(new GridLayout(1,0));
        mainBodySubPanel3.setPreferredSize(new Dimension(850,160));
        mainBodySubPanel3.setBorder(BorderFactory.createTitledBorder("Quote and Service Information"));
        
        //-----------------------------------------------
        JPanel quoteDataPanel = new JPanel();
        quoteDataPanel.setLayout(null);
        //quoteDataPanel.setBackground(Color.WHITE);
        quoteDataPanel.setPreferredSize(new Dimension(10, 10));
        quoteDataPanel.setOpaque(true); //content panes must be opaque
        //mainBodySubPanel3.add(quoteDataPanel);
        
        JLabel lquoteNo = new JLabel("Quote No*"); 
        lquoteNo.setFont(new Font("Arial", Font.PLAIN, 14)); 
        lquoteNo.setSize(210, 20); 
        lquoteNo.setLocation(20, 10); 
        quoteDataPanel.add(lquoteNo);
        
        
        
        
        
        
        
        
        
        
        //------------------------------------------------        
        JPanel serviceDataPanel = new JPanel();
        serviceDataPanel.setLayout(new GridLayout(1,0));
        serviceDataPanel.setBackground(Color.WHITE);
        serviceDataPanel.setPreferredSize(new Dimension(10, 10));
        serviceDataPanel.setOpaque(true); //content panes must be opaque
        
        
        
        
        
        
        
        
        
        
        
        
        
        //_____________________________________________________________
        
        JTabbedPane tabbedPane2 = new JTabbedPane(JTabbedPane.TOP);
        tabbedPane2.addTab("Quote Data", mainBodySubPanel3.add(quoteDataPanel));
        tabbedPane2.addTab("Service Data", mainBodySubPanel3.add(serviceDataPanel));
        //_____________________________________________________________
        
        mainBodySubPanel3.add(tabbedPane2);
        mainBodyPanel.add(mainBodySubPanel3);
        
        //---------------------------------------------------------------------------
        //Quote Sub Panel 4: Customer Quotes and Service Notes
       
        JPanel mainBodySubPanel4 = new JPanel();
        mainBodySubPanel4.setLayout(new GridLayout(1,0));
        mainBodySubPanel4.setPreferredSize(new Dimension(850,130));
        mainBodySubPanel4.setBorder(BorderFactory.createTitledBorder("Appointment, Quote and Service Notes"));
        
        //-------------------------------------------------------------------------
        
        JPanel lappointmentNotesPanel = new JPanel();
        lappointmentNotesPanel.setLayout(new GridLayout(1,0));
        lappointmentNotesPanel.setBackground(Color.WHITE);
        lappointmentNotesPanel.setPreferredSize(new Dimension(10, 10));
        lappointmentNotesPanel.setOpaque(true); //content panes must be opaque
        
        //Add Text to Customer Notes Tab
        tappointmentNotesPanel = new JTextArea(5,62); 
        tappointmentNotesPanel.setFont(new Font("Arial", Font.PLAIN, 15)); 
        tappointmentNotesPanel.setSize(185, 160); 
        tappointmentNotesPanel.setLocation(1, 0);
        tappointmentNotesPanel.setBackground(Color.WHITE);
        tappointmentNotesPanel.setLineWrap(true);
        tappointmentNotesPanel.setWrapStyleWord(true);
        tappointmentNotesPanel.setEditable(true);
        
        JScrollPane appointmentNotesScroll = new JScrollPane (tappointmentNotesPanel);
        appointmentNotesScroll.setVerticalScrollBarPolicy (ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
        lappointmentNotesPanel.add(appointmentNotesScroll);
        //tserviceNotes.setNextFocusableComponent(tquoteNotes);
        tappointmentNotesPanel.addKeyListener(new KeyAdapter() {
            @Override
            public void keyPressed(KeyEvent e) {
                if (e.getKeyCode() == KeyEvent.VK_TAB) {
                    if (e.getModifiersEx() > 0) {
                        tappointmentNotesPanel.transferFocusBackward();
                    } else {
                        tappointmentNotesPanel.transferFocus();
                    }
                    e.consume();
                }
            }
        });   
        
        
        
        
        
        
        
        
        
        
        //---------------------------------------------------------------------------------------------  
        //Staff Services Sub Panel 3: Tabbed Sub Panel Tentative Bookings Tab
        
        JPanel customerNotesPanel = new JPanel();
        customerNotesPanel.setLayout(new GridLayout(1,0));
        customerNotesPanel.setBackground(Color.WHITE);
        customerNotesPanel.setPreferredSize(new Dimension(10, 10));
        customerNotesPanel.setOpaque(true); //content panes must be opaque
        
        //Add Text to Customer Notes Tab
        tquoteNotes = new JTextArea(5,62); 
        tquoteNotes.setFont(new Font("Arial", Font.PLAIN, 15)); 
        tquoteNotes.setSize(185, 160); 
        tquoteNotes.setLocation(1, 0);
        tquoteNotes.setBackground(Color.WHITE);
        tquoteNotes.setLineWrap(true);
        tquoteNotes.setWrapStyleWord(true);
        tquoteNotes.setEditable(true);
        
        JScrollPane customerNotesScroll = new JScrollPane (tquoteNotes);
        customerNotesScroll.setVerticalScrollBarPolicy (ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
        customerNotesPanel.add(customerNotesScroll);
        //tserviceNotes.setNextFocusableComponent(tquoteNotes);
        tquoteNotes.addKeyListener(new KeyAdapter() {
            @Override
            public void keyPressed(KeyEvent e) {
                if (e.getKeyCode() == KeyEvent.VK_TAB) {
                    if (e.getModifiersEx() > 0) {
                        tquoteNotes.transferFocusBackward();
                    } else {
                        tquoteNotes.transferFocus();
                    }
                    e.consume();
                }
            }
        });   
        
        
        
        
        
        
                             
        //--------------------------------------------------------------------------------------------- 
        //Staff Services Sub Panel 3: Tabbed Sub Panel Confirmed Bookings Tab
        
        JPanel serviceNotesPanel = new JPanel();
        serviceNotesPanel.setLayout(new GridLayout(1,0));
        serviceNotesPanel.setBackground(Color.WHITE);
        serviceNotesPanel.setPreferredSize(new Dimension(10, 10));
        serviceNotesPanel.setOpaque(true); //content panes must be opaque
        
        
        tserviceNotes = new JTextArea(5,62); 
        tserviceNotes.setFont(new Font("Arial", Font.PLAIN, 15)); 
        tserviceNotes.setSize(185, 160); 
        tserviceNotes.setLocation(1, 0);
        tserviceNotes.setBackground(Color.WHITE);
        tserviceNotes.setLineWrap(true);
        tserviceNotes.setWrapStyleWord(true);
        tserviceNotes.setEditable(true);
        
        JScrollPane serviceNotesScroll = new JScrollPane (tserviceNotes);
        serviceNotesScroll.setVerticalScrollBarPolicy (ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
        serviceNotesPanel.add(serviceNotesScroll);
        //tcost.setNextFocusableComponent(tserviceNotes);

        tserviceNotes.addKeyListener(new KeyAdapter() {
            @Override
            public void keyPressed(KeyEvent e) {
                if (e.getKeyCode() == KeyEvent.VK_TAB) {
                    if (e.getModifiersEx() > 0) {
                        tserviceNotes.transferFocusBackward();
                    } else {
                        tserviceNotes.transferFocus();
                    }
                    e.consume();
                }
            }
        });
        
        
        
        
        
        
        
        
        
        
        //Add Text to Service Notes Tab
        
       
        //-------------------------------------------------------------------------------
        JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.BOTTOM);
        tabbedPane.addTab("Appointment Notes", mainBodySubPanel4.add(lappointmentNotesPanel));
        tabbedPane.addTab("Quote Notes", mainBodySubPanel4.add(customerNotesPanel));
        tabbedPane.addTab("Service Notes", mainBodySubPanel4.add(serviceNotesPanel));
        
        //-------------------------------------------------------------------------------
        
        //Customer Sub Panel 4: Button Panel
        JPanel buttonPanel = new JPanel();
        buttonPanel.setBackground(Color.WHITE);
        
        submit = new JButton("Save");
        //submit.setOpaque(false);
        //submit.setContentAreaFilled(false);
        //submit.setBorderPainted(false);
        submit.addActionListener(this);
        //tserviceType.setNextFocusableComponent(submit);
        
        clear = new JButton("Reset");
        //clear.setJTabbedPane(false);
        //clear.setBorderPainted(false);
        clear.addActionListener(this);
        submit.setNextFocusableComponent(clear);

        JButton close = new JButton("Close");
        close.addActionListener(e -> {
            this.dispose();
        });

        clear.setNextFocusableComponent(close);
        close.setNextFocusableComponent(tappointmentDate);

        buttonPanel.add(submit);
        buttonPanel.add(clear);
        buttonPanel.add(close);
        
        
        
        mainBodyPanel.add(mainBodySubPanel1);
        mainBodyPanel.add(mainBodySubPanel2);
        mainBodyPanel.add(mainBodySubPanel3);
        mainBodySubPanel4.add(tabbedPane);
        mainBodyPanel.add(mainBodySubPanel4);
        
        
        
        
        
        getContentPane().add(BorderLayout.NORTH, menuBar);
        getContentPane().add(BorderLayout.CENTER, mainBodyPanel);
        getContentPane().add(BorderLayout.SOUTH, buttonPanel);
        setVisible(true);
        
    }
    
        
    //---------------------------------------------------------------------------------------------
    public void actionPerformed(ActionEvent e) {
        
        try {
                if (e.getSource() == listCustomer) {
                    ListCustomersByName lcn = new ListCustomersByName();
                    lcn.listCustomersByName(QUOTE);
                    setVisible(true);
                }
                else
                    if (e.getSource() == listPreparedBy) {
                        ListStaffByName lsn = new ListStaffByName();
                        lsn.listStaffByName(QUOTE, 1);
                        setVisible(true);
                    }
                    else
                      if (e.getSource() == listAssignedTo) {
                            ListStaffByName lsn = new ListStaffByName();
                            lsn.listStaffByName(QUOTE, 2);
                            setVisible(true);
                       }
                       else
                         if (e.getSource() == listService) {
                                ListServicesByName lsn = new ListServicesByName();
                                lsn.listServicesByName(QUOTE);
                                setVisible(true);
                          }
        }
        catch (Exception ex) {  
            System.out.println(ex);
        }
        
        
        
                        if (e.getSource() == submit) {
                           //Get all the information from the input screen and assign them to the respective variables
                           String s1 = null;
                           String s2 = tappointmentDate.getText();
                           String s3 = customerNo;
                           String s4 = tstatus.getSelectedItem().toString();   
                           String s5 = preparedByStaffNo;
                           String s6 = assignedToStaffNo;
                           String s7 = tvalidDate.getText();
                           String s8 = serviceNo;
                           String s9 = tserviceType.getSelectedItem().toString();
                           String s10 = testimatedDuration.getText();
                           String s11 = tunitOfMeasureType.getSelectedItem().toString();
                           String s12 = tcost.getText();
                           String s13 = tserviceNotes.getText();
                           String s14 = tquoteNotes.getText();
            
                        //Check to ensure that data is input in all required fields
                        if (!s2.equals("") && !s3.equals("") && !s4.equals("") && !s5.equals("") && !s7.equals("") && !s8.equals("") && !s9.equals("")
                           && !s10.equals("") && !s11.equals("") && !s12.equals("") && !s13.equals("")) {
                    
                   try {
                        //Create a query with masked (?) input data values
                        String query = "INSERT INTO QUOTE VALUES(null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
                        da.ps = da.con.prepareStatement(query);
                        
                        //da.ps.setString(1, s1);    //Service No
                        
                        //set that input data for each masked input specified in the query
                        da.ps.setString(1, s2);    //Service Name
                        da.ps.setString(2, s3);    //Service Type
                        da.ps.setString(3, s4);    //Est Duration
                        da.ps.setString(4, s5);    //Unit of Measure
                        da.ps.setString(5, s6);    //Cost
                        da.ps.setString(6, s7);    //Service Notes
                        da.ps.setString(7, s8);
                        da.ps.setString(8, s9);
                        da.ps.setString(9, s10);
                        da.ps.setString(10, s11);
                        da.ps.setString(11, s12);
                        da.ps.setString(12, s13);
                        da.ps.setString(13, s14);
                        
                        
                        //Execute the SQL statement to insert data into the SMS database
                        if (da.ps.executeUpdate() > 0) {  
                           JOptionPane.showMessageDialog(null, "New Quote Created Successfully");
                           //Reset all fields in the Service Registration form
                            
                           tappointmentDate.setText("");
                           tappointmentTime.setText("");
                           listCustomer.setEnabled(false);
                           tstatus.setSelectedIndex(0);
                           ttimesSchedule.setText("");
                           listPreparedBy.setEnabled(false);
                           tassignedTo.setText("");
                           listAssignedTo.setEnabled(false);
                           tservice.setText("");
                           tvalidDate.setText("");
                           listService.setEnabled(false);
                           tserviceType.setSelectedIndex(0);
                           testimatedDuration.setText("");
                           tunitOfMeasureType.setSelectedIndex(0);
                           tcost.setText("");
                           tserviceNotes.selectAll();
                           tserviceNotes.replaceSelection(""); 
                           tquoteNotes.selectAll();
                           tquoteNotes.replaceSelection("");   
                                              
                        }
                        else {
                            JOptionPane.showMessageDialog(null, "Error: Data Not Saved\nPlease check data input and try again");
                        }
                     }
                     catch (Exception ex) {  
                            System.out.println(ex);  
                                                 }
                        }
                          else {
                          JOptionPane.showMessageDialog(null, "Error: Missing data\nPlease ensure all required data fields are populated \nincluding Service Notes and try again");
                        }
                          /*}
                          else {  
                          //Reset all fields in the Service Registration form
                          tappointmentDate.setText("");
                          tappointmentTime.setText("");
                          listCustomer.setEnabled(false);
                          tstatus.setSelectedIndex(0);
                          ttimesSchedule.setText("");
                          listPreparedBy.setEnabled(false);
                          tassignedTo.setText("");
                          listAssignedTo.setEnabled(false);
                          tservice.setText("");
                          tvalidDate.setText("");
                          listService.setEnabled(false);
                          tserviceType.setSelectedIndex(0);
                          testimatedDuration.setText("");
                          tunitOfMeasureType.setSelectedIndex(0);
                          tcost.setText("");
                          tserviceNotes.selectAll();
                          tserviceNotes.replaceSelection(""); 
                          tquoteNotes.selectAll();
                          tquoteNotes.replaceSelection("");  */
            
              
    
        }
    }        
    
}

Please do not make posts about school assignments