private int nextIndex(Window[] windows, int index) {
		if (forward) {
			int next = index + 1;
			return next >= windows.length ? 0 : next;
		}
		int previous = index - 1;
		return previous < 0 ? windows.length - 1 : previous;
	}
Action for transferring focus to the next or previous visible window in the application.
Ghidra/Framework/Docking/src/main/java/docking/action/NextPreviousWindowAction.java