From a9f8e21b9b476dab3b31cd724930a485bf492374 Mon Sep 17 00:00:00 2001 From: Aleksandr Zvegintsev Date: Tue, 12 Mar 2024 00:23:53 +0100 Subject: [PATCH] review comments --- .../jdk/java/awt/FileDialog/MultipleMode.java | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/test/jdk/java/awt/FileDialog/MultipleMode.java b/test/jdk/java/awt/FileDialog/MultipleMode.java index 9276280ac5117..a6a2cccff5b95 100644 --- a/test/jdk/java/awt/FileDialog/MultipleMode.java +++ b/test/jdk/java/awt/FileDialog/MultipleMode.java @@ -24,7 +24,6 @@ import java.awt.BorderLayout; import java.awt.Button; import java.awt.Checkbox; -import java.awt.EventQueue; import java.awt.FileDialog; import java.awt.FlowLayout; import java.awt.Frame; @@ -56,21 +55,18 @@ public class MultipleMode { """; public static void main(String[] args) throws Exception { - - PassFailJFrame passFailJFrame = PassFailJFrame - .builder() - .title("MultipleMode test instructions") - .instructions(INSTRUCTIONS) - .rows(15) - .columns(40) - .build(); - - EventQueue.invokeAndWait(MultipleMode::init); - - passFailJFrame.awaitAndCheck(); + PassFailJFrame + .builder() + .title("MultipleMode test instructions") + .instructions(INSTRUCTIONS) + .rows(15) + .columns(40) + .testUI(MultipleMode::init) + .build() + .awaitAndCheck(); } - private static void init() { + private static Frame init() { Frame frame = new Frame("MultipleMode"); TextArea sysout = new TextArea("", 20, 80); sysout.setEditable(false); @@ -79,7 +75,7 @@ private static void init() { Button open = new Button("open"); open.addActionListener(e -> { - FileDialog d = new FileDialog((Frame)null); + FileDialog d = new FileDialog(frame); d.setMultipleMode(mode.getState()); d.setVisible(true); @@ -104,10 +100,6 @@ private static void init() { frame.pack(); - PassFailJFrame.addTestWindow(frame); - PassFailJFrame.positionTestWindow(frame, - PassFailJFrame.Position.HORIZONTAL); - - frame.setVisible(true); + return frame; } }