Skip to content
Permalink
Browse files
8241808: [TESTBUG] The JDK-8039467 bug appeared on macOS
Reviewed-by: kizune, pbansal
  • Loading branch information
mrserb committed Apr 1, 2020
1 parent 1ef1131 commit 978120f46a652d01aaf675d69bd265040afd5d78
Showing 1 changed file with 15 additions and 5 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -38,10 +38,18 @@
* summary:
*/

import java.awt.*;
import java.awt.event.*;
import java.awt.AWTEvent;
import java.awt.Choice;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.Robot;
import java.awt.Window;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;

import test.java.awt.regtesthelpers.AbstractTest;
import test.java.awt.regtesthelpers.Sysout;
import test.java.awt.regtesthelpers.Util;

public class UnfocusableToplevel {
@@ -69,6 +77,8 @@ public static void main(String []s)
// disturb the environment. So creating tempFrameToHoldFocus frame,
// to consume key press events.
Frame tempFrameToHoldFocus = new Frame();
tempFrameToHoldFocus.setSize(300, 300);
tempFrameToHoldFocus.setLocationRelativeTo(null);
tempFrameToHoldFocus.setVisible(true);
Util.waitForIdle(robot);

@@ -93,7 +103,7 @@ public void itemStateChanged(ItemEvent ie){
traceEvent("stateChanged", ie);
}
});

w.setLocationRelativeTo(null);
w.setVisible(true);

Util.waitForIdle(robot);

0 comments on commit 978120f

Please sign in to comment.