code: private void cmdCreateNewActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_buttonAcceptActionPerformed
  		String id = txtQueryID.getText();
  		String group = (String) cmbQueryGroup.getSelectedItem();
  
  		if (id.isEmpty()) {
  			JOptionPane.showMessageDialog(this, "The query ID can't be blank!", "Error", JOptionPane.ERROR_MESSAGE);
  			return;
  		}
  		final int index = queryController.getElementPosition(id);
  		if (index != -1) {
  			JOptionPane.showMessageDialog(this, "The query or group ID already exists!", "Error", JOptionPane.ERROR_MESSAGE);
  			return;
  		}
  
  		if (group.equals(NOGROUP)) { // no group selected
  			queryController.addQuery(query, id);
  		} else if (group.equals(NEWGROUP)) { // create a new group
  			group = txtGroupName.getText().trim();
  			if (group.isEmpty()) {
  				JOptionPane.showMessageDialog(this, "The group ID can't be blank!", "Error", JOptionPane.ERROR_MESSAGE);
  				return;
  			}
  			//query and group ID have not yet been added to the queryController elements, but we need to prevent the use of the same name for both
  			if (id.equals(group)){
                  JOptionPane.showMessageDialog(this, "The group ID can't have the same name as the query ID!", "Error", JOptionPane.ERROR_MESSAGE);
                  return;
              }
  			try {
  				queryController.createGroup(group);
  				queryController.addQuery(query, id, group);
  			} catch (Exception e) {
  
                  OptionPaneUtils.showPrettyMessageDialog(this, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
  
  				return;
  			}
  		} else { // a group selected
  			queryController.addQuery(query, id, group);
  		}
  		parent.dispose();
  	}
docs: </editor-fold>//GEN-END:initComponents