public void setCancelButtonVisibility(boolean visible) {

		if (visible == showingCancelButton) {
			return;
		}

		if (visible) {
			add(cancelPanel, BorderLayout.EAST);
		}
		else {
			remove(cancelPanel);
		}

		repaint();
		showingCancelButton = visible;
	}
Set the visibility of the cancel button

@param visible if true, show the cancel button; false otherwise
Ghidra/Framework/Docking/src/main/java/ghidra/util/task/TaskMonitorComponent.java