Skip to content

Commit 513269d

Browse files
committed
8196093: javax/swing/JComboBox/8072767/bug8072767.java fails
Reviewed-by: prr
1 parent 643ddc1 commit 513269d

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

test/jdk/ProblemList.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,6 @@ javax/swing/JSplitPane/4201995/bug4201995.java 8079127 generic-all
738738
javax/swing/JTree/DnD/LastNodeLowerHalfDrop.java 8159131 linux-all
739739
javax/swing/JTree/4633594/JTreeFocusTest.java 8173125 macosx-all
740740
javax/swing/AbstractButton/6711682/bug6711682.java 8060765 windows-all,macosx-all
741-
javax/swing/JComboBox/8072767/bug8072767.java 8196093 windows-all,macosx-all
742741
javax/swing/JFileChooser/4524490/bug4524490.java 8042380 generic-all
743742
javax/swing/JFileChooser/6396844/TwentyThousandTest.java 8198003 generic-all
744743
javax/swing/JFrame/8175301/ScaledFrameBackgroundTest.java 8193942 generic-all

test/jdk/javax/swing/JComboBox/8057893/bug8057893.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
* @test
3636
* @key headful
3737
* @bug 8057893
38-
* @author Alexander Scherbatiy
3938
* @summary JComboBox actionListener never receives "comboBoxEdited"
4039
* from getActionCommand
4140
* @run main bug8057893
@@ -47,7 +46,7 @@ public class bug8057893 {
4746

4847
public static void main(String[] args) throws Exception {
4948
Robot robot = new Robot();
50-
robot.setAutoDelay(50);
49+
robot.setAutoDelay(100);
5150

5251
EventQueue.invokeAndWait(() -> {
5352
frame = new JFrame();
@@ -66,10 +65,12 @@ public void actionPerformed(ActionEvent e) {
6665
frame.add(comboBox);
6766
frame.pack();
6867
frame.setVisible(true);
68+
frame.setLocationRelativeTo(null);
6969
comboBox.requestFocusInWindow();
7070
});
7171

7272
robot.waitForIdle();
73+
robot.delay(1000);
7374

7475
robot.keyPress(KeyEvent.VK_A);
7576
robot.keyRelease(KeyEvent.VK_A);

test/jdk/javax/swing/JComboBox/8072767/bug8072767.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
* @test
4040
* @key headful
4141
* @bug 8072767
42-
* @author Alexander Scherbatiy
4342
* @summary DefaultCellEditor for comboBox creates ActionEvent with wrong source
4443
* object
4544
* @run main bug8072767
@@ -52,22 +51,23 @@ public class bug8072767 {
5251

5352
private static JFrame frame;
5453
private static JTable table;
55-
private static Point point;
54+
private static volatile Point point;
5655
private static boolean testPass;
5756

5857
public static void main(String[] args) throws Exception {
5958
Robot robot = new Robot();
60-
robot.setAutoDelay(50);
59+
robot.setAutoDelay(100);
6160
SwingUtilities.invokeAndWait(bug8072767::createAndShowGUI);
6261
robot.waitForIdle();
62+
robot.delay(1000);
6363
SwingUtilities.invokeAndWait(() -> {
6464
point = table.getLocationOnScreen();
6565
Rectangle rect = table.getCellRect(0, 0, true);
6666
point.translate(rect.width / 2, rect.height / 2);
6767
});
6868
robot.mouseMove(point.x, point.y);
69-
robot.mousePress(InputEvent.BUTTON1_MASK);
70-
robot.mouseRelease(InputEvent.BUTTON1_MASK);
69+
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
70+
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
7171
robot.waitForIdle();
7272

7373
robot.keyPress(KeyEvent.VK_1);
@@ -80,8 +80,8 @@ public static void main(String[] args) throws Exception {
8080
});
8181

8282
robot.mouseMove(point.x, point.y);
83-
robot.mousePress(InputEvent.BUTTON1_MASK);
84-
robot.mouseRelease(InputEvent.BUTTON1_MASK);
83+
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
84+
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
8585
robot.waitForIdle();
8686

8787
SwingUtilities.invokeAndWait(() -> {
@@ -98,7 +98,6 @@ private static void createAndShowGUI() {
9898
frame = new JFrame();
9999
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
100100
frame.setSize(200, 200);
101-
frame.setLocation(100, 100);
102101

103102
table = new JTable(
104103
new String[][]{{TEST1}}, new String[]{"Header"});
@@ -108,5 +107,6 @@ private static void createAndShowGUI() {
108107
new DefaultCellEditor(comboBox));
109108
frame.getContentPane().add(table);
110109
frame.setVisible(true);
110+
frame.setLocationRelativeTo(null);
111111
}
112112
}

0 commit comments

Comments
 (0)