From 4e0b03580d3764e06ec65493143e80c291fa3fbb Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 18 Jul 2025 06:13:26 +0000 Subject: [PATCH] 8338282: javax/swing/JMenuBar/TestMenuMnemonicLinuxAndMac.java test failed on macOS and Ubuntu Reviewed-by: tr, dnguyen, serb --- .../javax/swing/JMenuBar/TestMenuMnemonicLinuxAndMac.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/jdk/javax/swing/JMenuBar/TestMenuMnemonicLinuxAndMac.java b/test/jdk/javax/swing/JMenuBar/TestMenuMnemonicLinuxAndMac.java index 5fdf8f9aa27..e8aa15a74c4 100644 --- a/test/jdk/javax/swing/JMenuBar/TestMenuMnemonicLinuxAndMac.java +++ b/test/jdk/javax/swing/JMenuBar/TestMenuMnemonicLinuxAndMac.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2024, 2025, 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 @@ -41,7 +41,6 @@ import javax.swing.UIManager; * @key headful * @requires (os.family == "linux" | os.family == "mac") * @library /javax/swing/regtesthelpers - * @build Util * @summary Verifies if menu mnemonic toggle on Alt press in GTK and Aqua LAF * @run main TestMenuMnemonicLinuxAndMac */ @@ -117,5 +116,7 @@ public class TestMenuMnemonicLinuxAndMac { frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); + frame.toFront(); + frame.requestFocus(); } }