private void deleteTitleOrItem()
    {
         //user wants to delete a title
      if(categoryJComboBox.getSelectedIndex() == 0 && (!titleNameJTextField.getText().equals("")))
      {
          int option = JOptionPane.showConfirmDialog(this, "Are you sure you want to delete the entire Title?","Confirm Delete",JOptionPane.YES_NO_OPTION);
            if(option==JOptionPane.YES_OPTION)
               deleteTitle();  
      }else if(categoryJComboBox.getSelectedIndex() == 1 && (!titleNameJTextField.getText().equals(""))
             && (!itemNoJTextField.getText().equals("")))
      {
          int option = JOptionPane.showConfirmDialog(this, "Are you sure you want to delete the specified Item?","Confirm Delete",JOptionPane.YES_NO_OPTION);
            if(option==JOptionPane.YES_OPTION)
            {
                deleteItem();
                //updateAvailableItems();
            }
            
      }else
                    JOptionPane.showMessageDialog(null,"Please fill all the required fields","Something went wrong",JOptionPane.WARNING_MESSAGE);
      
    }