private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_exitMenuItemActionPerformed
    {//GEN-HEADEREND:event_exitMenuItemActionPerformed
        if(hasChanges)
        {
            int dialogResult = JOptionPane.showConfirmDialog(this, "You have unsaved changes, would you like to save these first?", "Question", JOptionPane.YES_NO_CANCEL_OPTION);
            switch(dialogResult)
            {
                case 0:
                    if(hasSavedToFile)
                        saveFile(curFile);
                    else
                        saveAs();
                    System.exit(0);
                    break;
                case 1:
                    System.exit(0);
                    break;
                case 2:
                    //cancel
                    break;
            }
        }
        else
        {
            System.exit(0);
        }
    }//GEN-LAST:event_exitMenuItemActionPerformed