Skip to content

Commit 0ed6d0b

Browse files
author
Alisen Chung
committedDec 14, 2022
8297296: java/awt/Mouse/EnterExitEvents/DragWindowTest.java fails with "No MouseReleased event on label!"
Reviewed-by: psadhukhan, dnguyen
1 parent a130c8a commit 0ed6d0b

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed
 

‎test/jdk/ProblemList.txt

-1
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,6 @@ java/awt/Window/8159168/SetShapeTest.java 8274106 macosx-aarch64
668668
java/awt/image/multiresolution/MultiResolutionJOptionPaneIconTest.java 8274106 macosx-aarch64
669669
javax/swing/JFrame/8175301/ScaledFrameBackgroundTest.java 8274106 macosx-aarch64
670670

671-
java/awt/Mouse/EnterExitEvents/DragWindowTest.java 8297296 macosx-all
672671
javax/swing/JFileChooser/8046391/bug8046391.java 8293862 windows-x64
673672
javax/swing/JFileChooser/4847375/bug4847375.java 8293862 windows-x64
674673
java/awt/Focus/NonFocusableWindowTest/NonfocusableOwnerTest.java 8280392 windows-x64

‎test/jdk/java/awt/Mouse/EnterExitEvents/DragWindowTest.java

+20-6
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,23 @@
3434
* @run main DragWindowTest
3535
*/
3636

37-
import java.awt.*;
38-
import java.awt.event.*;
39-
import javax.swing.*;
40-
41-
import java.util.concurrent.*;
37+
import java.awt.BorderLayout;
38+
import java.awt.Component;
39+
import java.awt.Rectangle;
40+
import java.awt.Robot;
41+
import java.awt.Panel;
42+
import java.awt.Point;
43+
import java.awt.Window;
44+
import java.awt.event.InputEvent;
45+
import java.awt.event.MouseAdapter;
46+
import java.awt.event.MouseEvent;
47+
import javax.swing.JFrame;
48+
import javax.swing.JLabel;
49+
import javax.swing.JButton;
50+
import javax.swing.JPanel;
51+
import javax.swing.SwingUtilities;
52+
53+
import java.util.concurrent.Callable;
4254

4355
import test.java.awt.regtesthelpers.Util;
4456

@@ -55,7 +67,7 @@ public class DragWindowTest {
5567
public static void main(String[] args) throws Exception {
5668

5769
Robot robot = new Robot();
58-
robot.setAutoDelay(50);
70+
robot.setAutoDelay(100);
5971

6072
SwingUtilities.invokeAndWait(new Runnable() {
6173

@@ -65,6 +77,7 @@ public void run() {
6577
}
6678
});
6779

80+
robot.delay(250);
6881
robot.waitForIdle();
6982

7083
Point pointToClick = Util.invokeOnEDT(new Callable<Point>() {
@@ -134,6 +147,7 @@ private static void createAndShowGUI() {
134147
panel.add(button, BorderLayout.CENTER);
135148

136149
frame.getContentPane().add(panel);
150+
frame.setLocationRelativeTo(null);
137151
frame.setVisible(true);
138152

139153
}

0 commit comments

Comments
 (0)
Please sign in to comment.