Skip to content

Commit

Permalink
Remove frame. Use JButton
Browse files Browse the repository at this point in the history
  • Loading branch information
DamonGuy committed Mar 21, 2024
1 parent 64f49ff commit 1ae72e3
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions test/jdk/java/awt/image/multiresolution/MultiDisplayTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
* questions.
*/

import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Color;
import java.awt.Dialog;
import java.awt.EventQueue;
Expand All @@ -34,7 +32,7 @@
import java.awt.image.BaseMultiResolutionImage;
import java.awt.image.BufferedImage;

import javax.swing.JFrame;
import javax.swing.JButton;

import jdk.test.lib.Platform;
import jtreg.SkippedException;
Expand All @@ -51,7 +49,6 @@
*/

public class MultiDisplayTest {
private static JFrame frame;
private static final String INSTRUCTIONS =
"""
The test requires two-display configuration, where
Expand Down Expand Up @@ -98,22 +95,18 @@ public static void main(String[] args) throws Exception {
.instructions(INSTRUCTIONS)
.rows((int) INSTRUCTIONS.lines().count() + 2)
.columns(40)
.testUI(MultiDisplayTest::createAndShowGUI)
.splitUIBottom(MultiDisplayTest::createAndShowGUI)
.build()
.awaitAndCheck();
}

public static JFrame createAndShowGUI() {
frame = new JFrame("MultiDisplayTest");
frame.setLayout(new BorderLayout());
Button b = new Button("Start");
public static JButton createAndShowGUI() {
JButton b = new JButton("Start");
b.addActionListener(e -> {
ParentFrame p = new ParentFrame();
new ChildDialog(p);
});
frame.add(b, BorderLayout.CENTER);
frame.pack();
return frame;
return b;
}

private static boolean checkOS() {
Expand Down

0 comments on commit 1ae72e3

Please sign in to comment.