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 import java.io.File;
25 import java.io.IOException;
26 import java.awt.BorderLayout;
27 import java.awt.Robot;
28 import java.awt.Toolkit;
29 import java.awt.event.ActionEvent;
30 import java.awt.event.ActionListener;
31 import java.awt.event.KeyEvent;
32 import javax.swing.JFileChooser;
33 import javax.swing.JFrame;
34 import javax.swing.SwingUtilities;
35 import sun.awt.SunToolkit;
36
37 /**
38 * @test
39 * @bug 8021253
40 * @author Alexander Scherbatiy
41 * @summary JFileChooser does not react on pressing enter since java 7
42 * @run main bug8021253
43 */
44
45 public class bug8021253 {
46
47 private static volatile boolean defaultKeyPressed;
48 private static JFileChooser fileChooser;
49 private static File file;
50
51 public static void main(String[] args) throws Exception {
52
53 SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
54 Robot robot = new Robot();
55 robot.setAutoDelay(50);
56
57 SwingUtilities.invokeAndWait(new Runnable() {
58 public void run() {
|
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 import java.io.File;
25 import java.io.IOException;
26 import java.awt.BorderLayout;
27 import java.awt.Robot;
28 import java.awt.Toolkit;
29 import java.awt.event.ActionEvent;
30 import java.awt.event.ActionListener;
31 import java.awt.event.KeyEvent;
32 import javax.swing.JFileChooser;
33 import javax.swing.JFrame;
34 import javax.swing.SwingUtilities;
35 import sun.awt.SunToolkit;
36
37 /**
38 * @test
39 * @key headful
40 * @bug 8021253
41 * @author Alexander Scherbatiy
42 * @summary JFileChooser does not react on pressing enter since java 7
43 * @run main bug8021253
44 */
45
46 public class bug8021253 {
47
48 private static volatile boolean defaultKeyPressed;
49 private static JFileChooser fileChooser;
50 private static File file;
51
52 public static void main(String[] args) throws Exception {
53
54 SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
55 Robot robot = new Robot();
56 robot.setAutoDelay(50);
57
58 SwingUtilities.invokeAndWait(new Runnable() {
59 public void run() {
|