code: private void cmdRemoveActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_removeQueryButtonActionPerformed
  		TreePath selected_path = treSavedQuery.getSelectionPath();
  		if (selected_path == null)
  			return;
  
  		if (JOptionPane.showConfirmDialog(this, "This will delete the selected query. \n Continue? ", "Delete confirmation",
  				JOptionPane.WARNING_MESSAGE, JOptionPane.YES_NO_OPTION) == JOptionPane.CANCEL_OPTION) {
  			return;
  		}
  
  		DefaultMutableTreeNode node = (DefaultMutableTreeNode) selected_path.getLastPathComponent();
  		if (node instanceof TreeElement) {
  			TreeElement element = (TreeElement) node;
  			QueryController qc = this.queryController;
  			if (node instanceof QueryTreeElement) {
  				qc.removeQuery(element.getID());
  			} else if (node instanceof QueryGroupTreeElement) {
  				qc.removeGroup(element.getID());
  			}
  		}
  		
  		
  	}
docs: GEN-LAST:event_cmdAddActionPerformed