27 import javax.swing.JLabel;
28 import javax.swing.JTextField;
29 import javax.swing.event.DocumentListener;
30 import javax.swing.event.UndoableEditListener;
31 import javax.swing.text.AttributeSet;
32 import javax.swing.text.BadLocationException;
33 import javax.swing.text.Document;
34 import javax.swing.text.Element;
35 import javax.swing.text.PlainDocument;
36 import javax.swing.text.Position;
37 import javax.swing.text.Segment;
38
39 import static java.awt.BorderLayout.NORTH;
40 import static java.awt.BorderLayout.SOUTH;
41 import static java.awt.Toolkit.getDefaultToolkit;
42 import static java.awt.event.KeyEvent.VK_LEFT;
43 import static javax.swing.SwingUtilities.invokeAndWait;
44
45 /*
46 * @test
47 * @bug 6968363
48 * @summary Ensures that a custom document may not extend AbstractDocument
49 * @author Sergey Malenkov
50 */
51 public class Test6968363 implements Runnable, Thread.UncaughtExceptionHandler {
52 private JFrame frame;
53
54 public static void main(String[] args) throws Exception {
55 SunToolkit toolkit = (SunToolkit) getDefaultToolkit();
56 Runnable task = new Test6968363();
57 invokeAndWait(task);
58 toolkit.realSync(100);
59 new Robot().keyPress(VK_LEFT);
60 toolkit.realSync(100);
61 invokeAndWait(task);
62 }
63
64 @Override
65 public void uncaughtException(Thread thread, Throwable throwable) {
66 throwable.printStackTrace();
|
27 import javax.swing.JLabel;
28 import javax.swing.JTextField;
29 import javax.swing.event.DocumentListener;
30 import javax.swing.event.UndoableEditListener;
31 import javax.swing.text.AttributeSet;
32 import javax.swing.text.BadLocationException;
33 import javax.swing.text.Document;
34 import javax.swing.text.Element;
35 import javax.swing.text.PlainDocument;
36 import javax.swing.text.Position;
37 import javax.swing.text.Segment;
38
39 import static java.awt.BorderLayout.NORTH;
40 import static java.awt.BorderLayout.SOUTH;
41 import static java.awt.Toolkit.getDefaultToolkit;
42 import static java.awt.event.KeyEvent.VK_LEFT;
43 import static javax.swing.SwingUtilities.invokeAndWait;
44
45 /*
46 * @test
47 * @key headful
48 * @bug 6968363
49 * @summary Ensures that a custom document may not extend AbstractDocument
50 * @author Sergey Malenkov
51 */
52 public class Test6968363 implements Runnable, Thread.UncaughtExceptionHandler {
53 private JFrame frame;
54
55 public static void main(String[] args) throws Exception {
56 SunToolkit toolkit = (SunToolkit) getDefaultToolkit();
57 Runnable task = new Test6968363();
58 invokeAndWait(task);
59 toolkit.realSync(100);
60 new Robot().keyPress(VK_LEFT);
61 toolkit.realSync(100);
62 invokeAndWait(task);
63 }
64
65 @Override
66 public void uncaughtException(Thread thread, Throwable throwable) {
67 throwable.printStackTrace();
|