This method initializes cancelButton

@return javax.swing.JButton
482176
private JButton getCancelButton() {
    if (cancelButton == null) {
      cancelButton = new JButton();
      cancelButton.setText("Cancel");
      cancelButton.setMnemonic('C');
      cancelButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent e) {
          cancelled = true;
          timedOut = false;
          restore();
          setVisible(false);
        }
      });
    }
    return cancelButton;
  }
1220585
private JButton getButtonAddActivities() {
        if (btnAddActivities == null) {
            btnAddActivities = new JButton();
            btnAddActivities.setAction(addActivitiesAction);
        }
        return btnAddActivities;
    }
613161
private void initComponents() {
    statusLabel = new javax.swing.JLabel();
    progressBar = new javax.swing.JProgressBar();
    cancelButton = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    statusLabel.setText("Progress...");

    progressBar.setIndeterminate(true);

    cancelButton.setMnemonic('C');
    cancelButton.setText("Cancel");
    cancelButton.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        cancelButtonActionPerformed(evt);
      }
    });

    /** TODO: Redo using Java 5 supported classes. */

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(progressBar, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
          .addComponent(statusLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
          .addComponent(cancelButton, javax.swing.GroupLayout.Alignment.TRAILING))
        .addContainerGap())
    );
    layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(statusLabel)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addComponent(cancelButton)
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    pack();
  }
792228
protected final JButton getButtonCancel() {
        if (buttonCancel == null) {
            buttonCancel = new JButton();
            buttonCancel.setText("Cancel");
            buttonCancel.setPreferredSize(new Dimension(80, 26));
            buttonCancel.addActionListener(new ActionListener() {
                public void actionPerformed(final ActionEvent e) {
                    if (destDirSelector != null) {
                        destDirSelector.cancel();
                    }
                }
            });
        }
        return buttonCancel;
    }
488073
private JButton getBtnOK() {
		if (btnOK == null) {
			btnOK = new JButton();
			btnOK.setText(Constant.messages.getString("all.button.ok"));
			btnOK.addActionListener(new java.awt.event.ActionListener() { 

				@Override
				public void actionPerformed(java.awt.event.ActionEvent e) {
				    try {
				    	Pattern.compile(getTxtPattern().getText());
				    } catch (Exception e1) {
				        // ZAP: i18n
				        view.showWarningDialog(Constant.messages.getString("filter.replacedialog.invalidpattern"));
				        getTxtPattern().grabFocus();
				        return;
				    }
				    getTxtPattern().discardAllEdits();
				    FilterReplaceDialog.this.dispose();
				    exitCode = JOptionPane.OK_OPTION;

				}
			});

		}
		return btnOK;
	}
1071022
public void setDefaultButton(SBaseButton button)
    {
        this.getScreenFieldView().setDefaultButton(button == null ? null : button.getScreenFieldView());
    }
158812
protected final JButton getButtonOK() {
        if (buttonOK == null) {
            buttonOK = new JButton();
            buttonOK.setText("OK");
            buttonOK.setPreferredSize(new Dimension(80, 26));
            buttonOK.addActionListener(new ActionListener() {
                public void actionPerformed(final ActionEvent e) {
                    if (destDirSelector != null) {
                        destDirSelector.ok();
                    }
                }
            });
        }
        return buttonOK;
    }
87184
private JButton getBtnApply() {
		if (btnApply == null) {
			btnApply = new JButton();
			btnApply.setText(Constant.messages.getString("history.filter.button.apply"));
			btnApply.addActionListener(new java.awt.event.ActionListener() { 

				@Override
				public void actionPerformed(java.awt.event.ActionEvent e) {    
					
					try {
						filter.setMethods(methodList.getSelectedValuesList());
						filter.setCodes(codeList.getSelectedValuesList());
						filter.setTags(tagList.getSelectedValuesList());
						filter.setRisks(riskList.getSelectedValuesList());
						filter.setReliabilities(confidenceList.getSelectedValuesList());
						filter.setNote(notesComboBox.getSelectedItem());
						filter.setUrlIncPatternList(strToRegexList(regexInc.getText()));
						filter.setUrlExcPatternList(strToRegexList(regexExc.getText()));
						exitResult = JOptionPane.OK_OPTION;
						HistoryFilterPlusDialog.this.dispose();
					} catch (PatternSyntaxException e1) {
						// Invalid regex
						View.getSingleton().showWarningDialog(
										Constant.messages.getString("history.filter.badregex.warning", e1.getMessage())); 

					}
					
				}
			});

		}
		return btnApply;
	}
1005432
public String getDefaultButtonsHtml() {

        StringBuffer result = new StringBuffer();
        String closeLabel = m_messages.key(Messages.GUI_CLOSE_0, new Object[] {});
        String detailsLabel = m_messages.key(Messages.GUI_DETAILS_0, new Object[] {});
        result.append("<div class=\"dialogbuttons\" unselectable=\"on\">");
        result.append("<input name=\"close\" type=\"button\" value=\"").append(closeLabel).append(
            "\" onclick=\"closeDialog();\" class=\"dialogbutton\">");
        result.append("<input name=\"details\" type=\"button\" value=\"").append(detailsLabel).append(
            "\" class=\"dialogbutton\" onclick=\"toggleElement('errordetails');\">");
        result.append("</div>");
        return result.toString();
    }
1266775
private View.OnTouchListener createCancelOnTouchListener() {
        return new View.OnTouchListener() {

            @Override
            public boolean onTouch(final View v, final MotionEvent event) {
                if (cancelable && canceledOnTouchOutside) {
                    cancel();
                    v.performClick();
                    return true;
                }

                return false;
            }

        };
    }
681449
protected AbstractButton getDataEditorButton() {
        if (dataEditorButton == null) {
            dataEditorButton = getDataEditorCommand().createButton();
            dataEditorButton.setFocusable(false);
            //dataEditorButton.addFocusListener(createFocusListener());
        }

        return dataEditorButton;
    }
342201
private JButton getBtnDisableAll() {
		if (btnDisableAll == null) {
			btnDisableAll = new JButton();
			btnDisableAll.setText(Constant.messages.getString("filter.button.disableall"));
			btnDisableAll.setEnabled(false);
			btnDisableAll.addActionListener(new java.awt.event.ActionListener() { 

				@Override
				public void actionPerformed(java.awt.event.ActionEvent e) {    

					
				}
			});

		}
		return btnDisableAll;
	}
878365
public String dialogButtonsCustom() {

        if (getPages().size() > 1) {
            // this is a multi page dialog, create buttons according to current page
            int pageIndex = getPages().indexOf(getParamPage());
            if (pageIndex == (getPages().size() - 1)) {
                // this is the last dialog page
                return dialogButtons(new int[] {BUTTON_OK, BUTTON_BACK, BUTTON_CANCEL}, new String[3]);
            } else if (pageIndex > 0) {
                // this is a dialog page between first and last page
                return dialogButtons(new int[] {BUTTON_BACK, BUTTON_CONTINUE, BUTTON_CANCEL}, new String[3]);
            } else {
                // this is the first dialog page
                return dialogButtons(new int[] {BUTTON_CONTINUE, BUTTON_CANCEL}, new String[2]);
            }
        }
        boolean onlyDisplay = true;
        Iterator<CmsWidgetDialogParameter> it = getWidgets().iterator();
        while (it.hasNext()) {
            CmsWidgetDialogParameter wdp = it.next();
            if (!(wdp.getWidget() instanceof CmsDisplayWidget)) {
                onlyDisplay = false;
                break;
            }
        }
        if (!onlyDisplay) {
            // this is a single page dialog, create common buttons
            return dialogButtons(new int[] {BUTTON_OK, BUTTON_CANCEL}, new String[2]);
        }
        // this is a display only dialog
        return "";
    }
373550
@SuppressWarnings({ "unchecked", "rawtypes" })
	private JPanel createButtonsPanel() {
		final JComboBox requestComboBox = new JComboBox(
				databaseInformations.getRequestNames().toArray());
		requestComboBox.setFont(requestComboBox.getFont().deriveFont(Font.BOLD));
		requestComboBox.setSelectedIndex(databaseInformations.getSelectedRequestIndex());
		requestComboBox.setRenderer(new DefaultListCellRenderer() {
			private static final long serialVersionUID = 1L;

			@Override
			public Component getListCellRendererComponent(JList list, Object value, int index,
					boolean isSelected, boolean cellHasFocus) {
				final String requestKey = (String) value;
				final String label = getString(requestKey);
				return super.getListCellRendererComponent(list, label, index, isSelected,
						cellHasFocus);
			}
		});
		requestComboBox.addItemListener(new ItemListener() {
			@Override
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED) {
					final int requestIndex = requestComboBox.getSelectedIndex();
					try {
						refresh(requestIndex);
					} catch (final IOException ex) {
						showException(ex);
					}
				}
			}
		});

		final MButton refreshButton = createRefreshButton();
		refreshButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				try {
					refresh(getDatabaseInformations().getSelectedRequestIndex());
				} catch (final IOException ex) {
					showException(ex);
				}
			}
		});
		final MButton pdfButton = createPdfButton();
		pdfButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				try {
					actionPdf();
				} catch (final IOException ex) {
					showException(ex);
				}
			}
		});
		final MButton xmlJsonButton = createXmlJsonButton(databaseInformations);

		return Utilities.createButtonsPanel(requestComboBox, new JLabel("             "),
				refreshButton, pdfButton, xmlJsonButton);
	}
953652
public Exception cancel(Exception error) {
		cancelled = true;
		if (error != null) {
			this.error = error;
		}
		return error;
	}
1174530
private JButton getBtnReset() {
		if (btnReset == null) {
			btnReset = new JButton();
			btnReset.setText(Constant.messages.getString("history.filter.button.clear"));
			btnReset.addActionListener(new java.awt.event.ActionListener() { 

				@Override
				public void actionPerformed(java.awt.event.ActionEvent e) {    

					exitResult = JOptionPane.NO_OPTION;
					// Unset everything
					methodList.setSelectedIndices(new int[0]);
					codeList.setSelectedIndices(new int[0]);
					tagList.setSelectedIndices(new int[0]);
					riskList.setSelectedIndices(new int[0]);
					confidenceList.setSelectedIndices(new int[0]);
					notesComboBox.setSelectedItem(HistoryFilter.NOTES_IGNORE);
					regexInc.setText("");
					regexExc.setText("");
					filter.reset();
				}
			});

		}
		return btnReset;
	}
1356754
private void setUpActionButtons() {
		// Buttons Panel
		WPanel buttonPanel = new WPanel();
		actionContainer.add(buttonPanel);

		// Edit Button
		final WButton editButton = new WButton("Edit") {
			@Override
			public boolean isVisible() {
				Object key = TableUtil.getCurrentRowKey();
				return !isEditRow(key);
			}
		};
		editButton.setImage("/image/pencil.png");
		editButton.setRenderAsLink(true);
		editButton.setToolTip("Edit");
		editButton.setAction(new Action() {
			@Override
			public void execute(final ActionEvent event) {
				Object key = TableUtil.getCurrentRowKey();
				addEditRow(key);
			}
		});

		// Cancel Button
		final WButton cancelButton = new WButton("Cancel") {
			@Override
			public boolean isVisible() {
				Object key = TableUtil.getCurrentRowKey();
				return isEditRow(key);
			}
		};
		cancelButton.setImage("/image/cancel.png");
		cancelButton.setRenderAsLink(true);
		cancelButton.setToolTip("Cancel");
		cancelButton.setAction(new Action() {
			@Override
			public void execute(final ActionEvent event) {
				Object key = TableUtil.getCurrentRowKey();
				removeEditRow(key);
				firstNameField.reset();
				lastNameField.reset();
				dobField.reset();
			}
		});

		// Delete Button
		WConfirmationButton deleteButton = new WConfirmationButton("Delete") {
			@Override
			public boolean isVisible() {
				Object key = TableUtil.getCurrentRowKey();
				return !isEditRow(key);
			}
		};
		deleteButton.setMessage("Do you want to delete row?");
		deleteButton.setImage("/image/remove.png");
		deleteButton.setRenderAsLink(true);
		deleteButton.setToolTip("Delete");
		deleteButton.setAction(new Action() {
			@Override
			public void execute(final ActionEvent event) {
				Object key = TableUtil.getCurrentRowKey();
				removeEditRow(key);
				PersonBean bean = (PersonBean) actionContainer.getBean();
				List<PersonBean> beans = (List<PersonBean>) table.getBean();
				beans.remove(bean);
				table.handleDataChanged();
				messages.success(bean.getFirstName() + " " + bean.getLastName() + " removed.");
			}
		});

		buttonPanel.add(editButton);
		buttonPanel.add(cancelButton);
		buttonPanel.add(deleteButton);

		// Ajax - edit button
		WAjaxControl editAjax = new WAjaxControl(editButton,
				new AjaxTarget[]{firstNameField, lastNameField,
					dobField, buttonPanel}) {
			@Override
			public boolean isVisible() {
				return editButton.isVisible();
			}

		};
		buttonPanel.add(editAjax);

		// Ajax - cancel button
		WAjaxControl cancelAjax = new WAjaxControl(cancelButton,
				new AjaxTarget[]{firstNameField, lastNameField,
					dobField, buttonPanel}) {
			@Override
			public boolean isVisible() {
				return cancelButton.isVisible();
			}
		};
		buttonPanel.add(cancelAjax);

		buttonPanel.setIdName("buttons");
		editAjax.setIdName("ajax_edit");
		cancelAjax.setIdName("ajax_can");
		editButton.setIdName("edit_btn");
		cancelButton.setIdName("cancel_btn");
		deleteButton.setIdName("delete_btn");
	}