@Override
	public boolean getScrollableTracksViewportWidth() {

		// Loop over all cells, getting the width of the largest cell.
		int width = 0;
		for (int row = 0; row < getRowCount(); row++) {
			TableCellRenderer rendererr = getCellRenderer(row, 0);
			Component comp = prepareRenderer(rendererr, row, 0);
			width = Math.max(comp.getPreferredSize().width, width);
		}

		// Now set the new preferred size using that max width, and the
		// existing preferred height.
		this.setPreferredSize(new Dimension(width, getPreferredSize().height));

		// Return true if the viewport has changed such that the table columns need to 
		// be resized.
		return getPreferredSize().width < getParent().getWidth();
	}
Must override this in order for horizontal scrolling to work. Scrolling
isn't automatically given when embedding a jtable in a scrollpanel; the
preferred width of the table must be explicitly set to the width of the
contents of the widest cell.

Note: We could override getPreferredSize() instead but we don't want to
change the default behavior for setting the preferred height, only the
width. So it's better to do it here.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/ui/PreviewTable.java