private void buildProgressPanel(boolean includeTextField, boolean includeCancelButton) {
		setLayout(new BorderLayout(5, 1));
		messageLabel = new GDHtmlLabel("               ") {
			@Override
			public void invalidate() {
				// don't care
			}
		};
		Gui.registerFont(messageLabel, MESSAGE_FONT_ID);
		Dimension d = messageLabel.getPreferredSize();
		d.width = 180;
		messageLabel.setPreferredSize(d);
		progressBar = new JProgressBar() {
			@Override
			public String getToolTipText() {
				if (isStringPainted()) {
					return getString();
				}

				return createProgressString();
			}
		};

		progressBar.setStringPainted(true);
		ToolTipManager.sharedInstance().registerComponent(progressBar);

		progressPanel = new HourglassAnimationPanel();

		progressBarPanel = new JPanel(new VerticalLayout(0));
		progressBarPanel.add(progressBar);
		if (includeTextField) {
			progressBarPanel.add(messageLabel);
			progressBar.setPreferredSize(new Dimension(180, 12));
		}
		else {
			progressBar.setBorderPainted(true);
			Dimension size = progressBar.getPreferredSize();
			progressBarPanel.setBorder(BorderFactory.createEmptyBorder(
				(progressPanel.getPreferredSize().height - size.height) / 2, 0, 0, 8));
		}

		mainContentPanel = new JPanel(new BorderLayout());
		mainContentPanel.add(progressBarPanel, BorderLayout.CENTER);
		mainContentPanel.add(progressPanel, BorderLayout.EAST);

		Icon icon = Icons.STOP_ICON;
		cancelButton = new EmptyBorderButton(icon);

		cancelButton.setName("CANCEL_TASK");
		cancelButton.setPreferredSize(new Dimension(icon.getIconWidth(), icon.getIconHeight()));
		cancelButton.addActionListener(e -> Swing.runLater(shouldCancelRunnable));
		cancelButton.setFocusable(false);
		cancelButton.setRolloverEnabled(true);

		add(mainContentPanel, BorderLayout.CENTER);

		if (includeCancelButton) {
			cancelPanel = new JPanel();
			cancelPanel.setLayout(new BoxLayout(cancelPanel, BoxLayout.Y_AXIS));
			cancelPanel.add(Box.createVerticalGlue());
			cancelPanel.add(cancelButton);
			cancelPanel.add(Box.createVerticalGlue());
			add(cancelPanel, BorderLayout.EAST);
		}
	}
Sets the visibility of the progress icon

@param visible if true, display the progress icon
Ghidra/Framework/Docking/src/main/java/ghidra/util/task/TaskMonitorComponent.java