8294067: [macOS] javax/swing/JComboBox/6559152/bug6559152.java Cannot select an item from popup with the ENTER key.
Reviewed-by: azvegint, psadhukhan
This commit is contained in:
parent
caae53f4da
commit
3b438a68ea
@ -24,29 +24,32 @@
|
|||||||
/*
|
/*
|
||||||
* @test
|
* @test
|
||||||
* @key headful
|
* @key headful
|
||||||
* @bug 6559152
|
* @bug 6559152 8294067
|
||||||
* @summary Checks that you can select an item in JComboBox with keyboard
|
* @summary Checks that you can select an item in JComboBox with keyboard
|
||||||
* when it is a JTable cell editor.
|
* when it is a JTable cell editor.
|
||||||
* @run main bug6559152
|
* @run main bug6559152
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Point;
|
||||||
|
import java.awt.Robot;
|
||||||
|
import java.awt.event.InputEvent;
|
||||||
|
import java.awt.event.KeyEvent;
|
||||||
|
|
||||||
import javax.swing.DefaultCellEditor;
|
import javax.swing.DefaultCellEditor;
|
||||||
|
import javax.swing.JComboBox;
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JTable;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.table.DefaultTableModel;
|
import javax.swing.table.DefaultTableModel;
|
||||||
import javax.swing.JTable;
|
|
||||||
import java.awt.Point;
|
|
||||||
import java.awt.event.KeyEvent;
|
|
||||||
import java.awt.event.InputEvent;
|
|
||||||
import java.awt.Robot;
|
|
||||||
|
|
||||||
public class bug6559152 {
|
public class bug6559152 {
|
||||||
private static JFrame frame;
|
private static JFrame frame;
|
||||||
private static JComboBox cb;
|
private static JComboBox cb;
|
||||||
private static Robot robot;
|
private static Robot robot;
|
||||||
private static Point p = null;
|
private static Point p = null;
|
||||||
|
private static Dimension d;
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
robot = new Robot();
|
robot = new Robot();
|
||||||
@ -69,6 +72,7 @@ public class bug6559152 {
|
|||||||
try {
|
try {
|
||||||
SwingUtilities.invokeAndWait(() -> {
|
SwingUtilities.invokeAndWait(() -> {
|
||||||
p = comp.getLocationOnScreen();
|
p = comp.getLocationOnScreen();
|
||||||
|
d = comp.getSize();
|
||||||
});
|
});
|
||||||
} catch (IllegalStateException e) {
|
} catch (IllegalStateException e) {
|
||||||
try {
|
try {
|
||||||
@ -97,7 +101,7 @@ public class bug6559152 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void test() throws Exception {
|
private static void test() throws Exception {
|
||||||
robot.mouseMove(p.x, p.y);
|
robot.mouseMove(p.x + d.width / 2, p.y + d.height / 2);
|
||||||
robot.waitForIdle();
|
robot.waitForIdle();
|
||||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user