private void doResetBounds() {
		// My bounds are tied to that of the text field passed in the constructor.  I'd like
		// to live at the end of the textField, away from the text, which is dependent upon 
		// the text alignment
		Container myParent = getParent();
		if (myParent == null) {
			return; // initializing
		}

		Rectangle textBounds = textField.getBounds();
		Insets textInsets = textField.getInsets();
		Point location = textBounds.getLocation();

		Dimension size = getPreferredSize();
		int half = (textBounds.height - size.height) / 2;
		int y = textBounds.y + half;

		int end = location.x + textBounds.width;
		int x = end - textInsets.right - size.width;

		// hide when text is near
		checkForTouchyText(x);

		setBounds(x, y, size.width, size.height);

		myParent.validate();
	}
A label that displays an icon that, when clicked, will clear the contents of the 
associated filter.
Ghidra/Framework/Docking/src/main/java/docking/widgets/filter/ClearFilterLabel.java