1
1
/*
2
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2012,2020 Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
27
27
* @bug 7158712
28
28
* @summary Synth Property "ComboBox.popupInsets" is ignored
29
29
* @library ../../../regtesthelpers
30
- * @author Pavel Porvatov
30
+ * @run main/othervm -Dsun.java2d.uiScale=1 bug7158712
31
31
*/
32
32
33
- import javax .swing .*;
33
+ import javax .swing .JComboBox ;
34
+ import javax .swing .JFrame ;
35
+ import javax .swing .SwingUtilities ;
34
36
import javax .swing .plaf .basic .BasicComboPopup ;
35
37
import javax .swing .plaf .synth .SynthLookAndFeel ;
36
- import java .awt .*;
38
+ import javax .swing .UIManager ;
39
+ import java .awt .BorderLayout ;
40
+ import java .awt .Dimension ;
41
+ import java .awt .Robot ;
42
+ import java .awt .Point ;
37
43
import java .awt .event .InputEvent ;
38
44
import java .io .ByteArrayInputStream ;
39
45
import java .util .concurrent .Callable ;
@@ -59,15 +65,15 @@ public class bug7158712 {
59
65
public static void main (String [] args ) throws Exception {
60
66
Robot robot = new Robot ();
61
67
62
- robot .setAutoDelay (500 );
68
+ robot .setAutoDelay (100 );
63
69
64
70
SynthLookAndFeel laf = new SynthLookAndFeel ();
65
71
66
72
laf .load (new ByteArrayInputStream (SYNTH_XML .getBytes ("UTF8" )), bug7158712 .class );
67
73
68
74
UIManager .setLookAndFeel (laf );
69
75
70
- EventQueue .invokeAndWait (new Runnable () {
76
+ SwingUtilities .invokeAndWait (new Runnable () {
71
77
public void run () {
72
78
comboBox = new JComboBox <>(
73
79
new String []{"Very Looooooooooooooooooooong Text Item 1" , "Item 2" });
@@ -83,6 +89,7 @@ public void run() {
83
89
});
84
90
85
91
robot .waitForIdle ();
92
+ robot .delay (1000 );
86
93
87
94
Point comboBoxLocation = Util .invokeOnEDT (new Callable <Point >() {
88
95
@ Override
0 commit comments