@Override
	public Dimension getPreferredSize() {

		Dimension dim = getSize();
		// calculate dimension
		int width = 0;
		int height = 20 * fontHeight + statusPanel.getHeight();
		if (dim != null) {
			height += dim.height;
		}
		boolean addHeight = true;
		for (ByteViewerComponent c : viewList) {

			Dimension d = c.getPreferredSize();
			width += d.width;
			width += 2; // for separator
			if (addHeight) {
				height += d.height;
				addHeight = false;
			}
		}

		if (width == 0) {
			width = statusPanel.getPreferredSize().width + 20; // add 20 for
			// border layout vertical gap
		}
		else {
			width += indexPanel.getPreferredSize().width;
		}
		return new Dimension(width, height);
	}
Return the size that this component would like to be.
Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ByteViewerPanel.java