< prev index next >

test/jdk/java/awt/List/KeyEventsTest/KeyEventsTest.java

Print this page

        

*** 20,53 **** * or visit www.oracle.com if you need additional information or have any * questions. */ /* ! test @bug 6190768 6190778 ! @summary Tests that triggering events on AWT list by pressing CTRL + HOME, CTRL + END, PG-UP, PG-DOWN similar Motif behavior ! @author Dmitry.Cherepanov@SUN.COM area=awt.list @library /test/lib @build jdk.test.lib.Platform ! @run applet KeyEventsTest.html */ - /** - * KeyEventsTest.html - * - * summary: - */ - - import java.applet.Applet; import java.awt.*; import java.awt.event.*; - import java.util.Set; import java.lang.reflect.*; import jdk.test.lib.Platform; ! public class KeyEventsTest extends Applet implements ItemListener, FocusListener, KeyListener { TestState currentState; final Object LOCK = new Object(); final int ACTION_TIMEOUT = 500; --- 20,46 ---- * or visit www.oracle.com if you need additional information or have any * questions. */ /* ! @test ! @key headful @bug 6190768 6190778 ! @summary Tests that triggering events on AWT list by pressing CTRL + HOME, ! CTRL + END, PG-UP, PG-DOWN similar Motif behavior @library /test/lib @build jdk.test.lib.Platform ! @run main KeyEventsTest */ import java.awt.*; import java.awt.event.*; import java.lang.reflect.*; import jdk.test.lib.Platform; ! public class KeyEventsTest extends Frame implements ItemListener, FocusListener, KeyListener { TestState currentState; final Object LOCK = new Object(); final int ACTION_TIMEOUT = 500;
*** 55,64 **** --- 48,63 ---- List multiple = new List(3, true); Panel p1 = new Panel (); Panel p2 = new Panel (); + public static void main(final String[] args) { + KeyEventsTest app = new KeyEventsTest(); + app.init(); + app.start(); + } + public void init() { setLayout (new BorderLayout ()); single.add("0");
*** 98,127 **** public void start () { try{ setSize (200,200); - setVisible(true); validate(); ! main(null); ! } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("The test failed."); } }// start() - private void main(String[] args) - throws InterruptedException, InvocationTargetException { - - doTest(); - - System.out.println("Test passed."); - } - public void itemStateChanged (ItemEvent ie) { System.out.println("itemStateChanged-"+ie); this.currentState.setAction(true); } --- 97,120 ---- public void start () { try{ setSize (200,200); validate(); + setUndecorated(true); + setLocationRelativeTo(null); + setVisible(true); ! doTest(); ! System.out.println("Test passed."); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("The test failed."); } }// start() public void itemStateChanged (ItemEvent ie) { System.out.println("itemStateChanged-"+ie); this.currentState.setAction(true); }
< prev index next >