Skip to content

Commit c61d62b

Browse files
committed
8341037: Use standard layouts in DefaultFrameIconTest.java and MenuCrash.java
Backport-of: c43202baf6eb7e49ec458037971a9efa392d053e
1 parent 57e792a commit c61d62b

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

test/jdk/java/awt/Frame/DefaultFrameIconTest.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,11 @@ public static void main(String[] args) throws Exception {
5050
.instructions(INSTRUCTIONS)
5151
.columns(45)
5252
.testUI(DefaultFrameIconTest::createAndShowUI)
53-
.positionTestUI(DefaultFrameIconTest::positionTestWindows)
53+
.positionTestUIRightRow()
5454
.build()
5555
.awaitAndCheck();
5656
}
5757

58-
private static void positionTestWindows(List<? extends Window> testWindows,
59-
PassFailJFrame.InstructionUI instructionUI) {
60-
int gap = 5;
61-
int x = instructionUI.getLocation().x + instructionUI.getSize().width + gap;
62-
for (Window w : testWindows) {
63-
w.setLocation(x, instructionUI.getLocation().y);
64-
x += w.getWidth() + gap;
65-
}
66-
}
67-
6858
private static List<Window> createAndShowUI() {
6959
Frame testFrame = new Frame("Frame DefaultFrameIconTest");
7060
Dialog testDialog = new Dialog(testFrame, "Dialog DefaultFrameIconTest");

test/jdk/java/awt/Frame/MenuCrash.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static void main(String[] args) throws Exception {
6262
.instructions(INSTRUCTIONS)
6363
.columns(45)
6464
.testUI(MenuCrash::createAndShowUI)
65-
.positionTestUI(MenuCrash::positionTestWindows)
65+
.positionTestUIRightRow()
6666
.build()
6767
.awaitAndCheck();
6868
}
@@ -81,16 +81,6 @@ private static List<Window> createAndShowUI() {
8181
return List.of(frame1, frame2);
8282
}
8383

84-
private static void positionTestWindows(List<? extends Window> testWindows,
85-
PassFailJFrame.InstructionUI instructionUI) {
86-
int gap = 5;
87-
int x = instructionUI.getLocation().x + instructionUI.getSize().width + gap;
88-
for (Window w : testWindows) {
89-
w.setLocation(x, instructionUI.getLocation().y);
90-
x += w.getWidth() + gap;
91-
}
92-
}
93-
9484
static class MenuFrame extends Frame {
9585
private final TextField field;
9686

0 commit comments

Comments
 (0)