private int addRow(Component leftComponent, Component... rightComponents) {
		if (leftComponent == null) {
			leftComponent = new GLabel();
		}
		Component rightComponent;
		if (rightComponents.length > 1) {
			JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT));
			for (Component c : rightComponents) {
				if (c != null) {
					panel.add(c);
				}
			}
			rightComponent = panel;
		}
		else {
			rightComponent = rightComponents[0];
		}
		optionsPanel.add(leftComponent);
		optionsPanel.add(rightComponent);
		return optionsPanelRowCount++;
	}
For test/screen shot use

@return button
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/strings/EncodedStringsDialog.java