private void set_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_set_buttonActionPerformed
        //Tries to set new counts.
        try 
        {
            //Checks the echocal widget identifier.
            switch (echocalWidgetIdentifier)
            {
                //In the case that the "Top" button set on the "Port" side widget.
                case "top_port":
                {
                    //Implements the set counts function in Communication class in the top port panel.
                    Communication.setCounts(UserInterface.selectedCommPort, "$"+(String)UserInterface.top_port_device_combobox.getSelectedItem(), UserInterface.top_port_set_textfield.getText());
                    //Tries to read counts of the downrigger of intended count modification.
                    try 
                    {
                        //Implements the read counts function in Communication class in the top port panel.
                        Communication.readCounts(UserInterface.selectedCommPort,"$"+(String)UserInterface.top_port_device_combobox.getSelectedItem());
                    } 
                    //If a PortInUseException, UnsupportedCommOperationException, IOException, InterruptedException, or NoSuchPortException is caught.
                    catch (PortInUseException | NoSuchPortException | UnsupportedCommOperationException | InterruptedException | IOException ex) 
                    {
                        //Informs the user with the netbeans debugger that the exception was caught.
                        Logger.getLogger(Set.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    //Breaks out of case statement.
                    break;
                }
                //In the case that the "Bottom" button set on the "Port" side widget.
                case "bottom_port":
                {
                    //Implements the set counts function in Communication class in the bottom port panel.
                    Communication.setCounts(UserInterface.selectedCommPort, "$"+(String)UserInterface.bottom_port_device_combobox.getSelectedItem(), UserInterface.bottom_port_set_textfield.getText());
                    //Tries to read counts of the downrigger of intended count modification.
                    try 
                    {
                        //Implements the read counts function in Communication class in the bottom port panel.
                        Communication.readCounts(UserInterface.selectedCommPort,"$"+(String)UserInterface.bottom_port_device_combobox.getSelectedItem());
                    } 
                    //If a PortInUseException, UnsupportedCommOperationException, IOException, InterruptedException, or NoSuchPortException is caught.
                    catch (PortInUseException | NoSuchPortException | UnsupportedCommOperationException | InterruptedException | IOException ex) 
                    {
                        //Informs the user with the netbeans debugger that the exception was caught.
                        Logger.getLogger(Set.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    //Breaks out of case statement.
                    break;
                }
                //In the case that the "Top" button set on the "Starboard" side widget.
                case "top_starboard":
                {
                    //Implements the set counts function in Communication classin the top starboard panel.
                    Communication.setCounts(UserInterface.selectedCommPort, "$"+(String)UserInterface.top_starboard_device_combobox.getSelectedItem(), UserInterface.top_starboard_set_textfield.getText());
                    //Tries to read counts of the downrigger of intended count modification.
                    try 
                    {
                        //Implements the read counts function in Communication class in the top starboard panel.
                        Communication.readCounts(UserInterface.selectedCommPort,"$"+(String)UserInterface.top_starboard_device_combobox.getSelectedItem());
                    } 
                    //If a PortInUseException, UnsupportedCommOperationException, IOException, InterruptedException, or NoSuchPortException is caught.
                    catch (PortInUseException | NoSuchPortException | UnsupportedCommOperationException | InterruptedException | IOException ex) 
                    {
                        //Informs the user with the netbeans debugger that the exception was caught.
                        Logger.getLogger(Set.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    //Breaks out of case statement.
                    break;
                }
                //In the case that the "Bottom" button set on the "Starboard" side widget.
                case "bottom_starboard":
                {
                    //Implements the set counts function in Communication class in the bottom starboard panel.
                    Communication.setCounts(UserInterface.selectedCommPort, "$"+(String)UserInterface.bottom_starboard_device_combobox.getSelectedItem(), UserInterface.bottom_starboard_set_textfield.getText());
                    //Tries to read counts of the downrigger of intended count modification.
                    try 
                    {
                        //Implements the read counts function in Communication class in the bottom starboard panel.
                        Communication.readCounts(UserInterface.selectedCommPort,"$"+(String)UserInterface.bottom_starboard_device_combobox.getSelectedItem());
                    } 
                    //If a PortInUseException, UnsupportedCommOperationException, IOException, InterruptedException, or NoSuchPortException is caught.
                    catch (PortInUseException | NoSuchPortException | UnsupportedCommOperationException | InterruptedException | IOException ex) 
                    {
                        //Informs the user with the netbeans debugger that the exception was caught.
                        Logger.getLogger(Set.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    //Breaks out of case statement.
                    break;
                }
                //If there is some error with the echocalWidgetIdentifier.
                default:
                {
                    //Breaks out of default statement.
                    break;
                }
            }
            //Closes the dialog window.
            super.setVisible(false);
        } 
        //If a PortInUseException, UnsupportedCommOperationException, IOException or NoSuchPortException is caught.
        catch (PortInUseException | UnsupportedCommOperationException | IOException | NoSuchPortException ex) 
        {
            //Informs the user with the netbeans debugger that the exception was caught.
            Logger.getLogger(Set.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_set_buttonActionPerformed