< prev index next >

test/jdk/javax/swing/text/AbstractDocument/6968363/Test6968363.java

Print this page




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




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


< prev index next >