11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @key headful
27 * @bug 7172652
28 * @summary With JDK 1.7 text field does not obtain focus when using mnemonic Alt/Key combin
29 * @author Semyon Sadetsky
30 * @requires (os.family == "windows")
31 * @library /lib/testlibrary
32 * @build jdk.testlibrary.OSInfo
33 * @run main bug7172652
34 */
35
36 import javax.swing.*;
37 import javax.swing.event.ChangeEvent;
38 import javax.swing.event.ChangeListener;
39 import java.awt.*;
40 import java.awt.event.KeyEvent;
41 import jdk.testlibrary.OSInfo;
42
43 public class bug7172652 {
44
45 private static JMenu menu;
46 private static JFrame frame;
47 private static Boolean selected;
48
49 public static void main(String[] args) throws Exception {
50 if (OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
51 System.out.println("ok");
52 return;
53 }
54 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
55 SwingUtilities.invokeAndWait(new Runnable() {
56 @Override
57 public void run() {
58 setup();
59 }
60 });
61
62 test();
63 SwingUtilities.invokeLater(new Runnable() {
64 @Override
65 public void run() {
66 frame.dispose();
67 }
68 });
69 }
70
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @key headful
27 * @bug 7172652
28 * @summary With JDK 1.7 text field does not obtain focus when using mnemonic Alt/Key combin
29 * @author Semyon Sadetsky
30 * @requires (os.family == "windows")
31 * @library /test/lib
32 * @build jdk.test.lib.Platform
33 * @run main bug7172652
34 */
35
36 import javax.swing.*;
37 import javax.swing.event.ChangeEvent;
38 import javax.swing.event.ChangeListener;
39 import java.awt.*;
40 import java.awt.event.KeyEvent;
41
42 import jdk.test.lib.Platform;
43
44 public class bug7172652 {
45
46 private static JMenu menu;
47 private static JFrame frame;
48 private static Boolean selected;
49
50 public static void main(String[] args) throws Exception {
51 if (!Platform.isWindows()) {
52 System.out.println("ok");
53 return;
54 }
55 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
56 SwingUtilities.invokeAndWait(new Runnable() {
57 @Override
58 public void run() {
59 setup();
60 }
61 });
62
63 test();
64 SwingUtilities.invokeLater(new Runnable() {
65 @Override
66 public void run() {
67 frame.dispose();
68 }
69 });
70 }
71
|