diff --git a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java index 5e27c503425..f287e17e503 100644 --- a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java +++ b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java @@ -1284,6 +1284,29 @@ public Builder testUI(WindowCreator windowCreator) { return this; } + /** + * Adds an implementation of {@link PositionWindows PositionWindows} + * which the framework will use to position multiple test UI windows. + * + * @param positionWindows an implementation of {@code PositionWindows} + * to position multiple test UI windows + * @return this builder + * @throws IllegalArgumentException if the {@code positionWindows} + * parameter is {@code null} + * @throws IllegalStateException if the {@code positionWindows} field + * is already set + */ + public Builder positionTestUI(PositionWindows positionWindows) { + if (positionWindows == null) { + throw new IllegalArgumentException("positionWindows parameter can't be null"); + } + if (this.positionWindows != null) { + throw new IllegalStateException("PositionWindows is already set"); + } + this.positionWindows = positionWindows; + return this; + } + /** * Adds a {@code WindowListCreator} which the framework will use * to create a list of test UI windows.