private int getColumn( int x, int width ) {
			TableColumnModel columnModel = header.getColumnModel();
			int columnCount = columnModel.getColumnCount();
			boolean ltr = header.getComponentOrientation().isLeftToRight();
			int cx = ltr ? 0 : getWidthInRightToLef();

			for( int i = 0; i < columnCount; i++ ) {
				int cw = columnModel.getColumn( i ).getWidth();
				if( x == cx - (ltr ? 0 : cw) && width == cw )
					return i;

				cx += ltr ? cw : -cw;
			}
			return -1;
		}
Get column index for given coordinates.
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTableHeaderUI.java