test/java/awt/Mixing/AWT_Mixing/JPopupMenuOverlapping.java

Print this page




  27 import java.awt.Robot;
  28 import java.awt.event.ActionEvent;
  29 import java.awt.event.ActionListener;
  30 import java.lang.reflect.InvocationTargetException;
  31 import javax.swing.JFrame;
  32 import javax.swing.JMenuItem;
  33 import javax.swing.JPopupMenu;
  34 import javax.swing.SpringLayout;
  35 import javax.swing.SwingUtilities;
  36 import test.java.awt.regtesthelpers.Util;
  37 
  38 /**
  39  * AWT/Swing overlapping test for {@link javax.swing.JPopupMenu } component.
  40  * <p>This test creates menu and test if heavyweight component is drawn correctly then menu dropdown is shown.
  41  * <p>See base class for test info.
  42  */
  43 /*
  44 @test
  45 @summary Overlapping test for javax.swing.JScrollPane
  46 @author sergey.grinev@oracle.com: area=awt.mixing
  47 @library ../../regtesthelpers
  48 @modules java.desktop/sun.awt
  49          java.desktop/java.awt.peer
  50 @compile/module=java.desktop java/awt/Helper.java
  51 @build Util
  52 @run main JPopupMenuOverlapping
  53  */
  54 public class JPopupMenuOverlapping extends OverlappingTestBase {
  55 
  56     {testEmbeddedFrame = true;}
  57 
  58     private boolean lwClicked = false;
  59     private Point loc;
  60     private JPopupMenu popup;
  61     private JFrame frame=null;
  62 
  63     protected void prepareControls() {
  64         if(frame != null) {
  65             frame.setVisible(false);
  66         }
  67         frame = new JFrame("Mixing : Dropdown Overlapping test");
  68         frame.setLayout(new SpringLayout());
  69         frame.setSize(200, 200);
  70 




  27 import java.awt.Robot;
  28 import java.awt.event.ActionEvent;
  29 import java.awt.event.ActionListener;
  30 import java.lang.reflect.InvocationTargetException;
  31 import javax.swing.JFrame;
  32 import javax.swing.JMenuItem;
  33 import javax.swing.JPopupMenu;
  34 import javax.swing.SpringLayout;
  35 import javax.swing.SwingUtilities;
  36 import test.java.awt.regtesthelpers.Util;
  37 
  38 /**
  39  * AWT/Swing overlapping test for {@link javax.swing.JPopupMenu } component.
  40  * <p>This test creates menu and test if heavyweight component is drawn correctly then menu dropdown is shown.
  41  * <p>See base class for test info.
  42  */
  43 /*
  44 @test
  45 @summary Overlapping test for javax.swing.JScrollPane
  46 @author sergey.grinev@oracle.com: area=awt.mixing
  47 @library /java/awt/patchlib  ../../regtesthelpers
  48 @modules java.desktop/sun.awt
  49          java.desktop/java.awt.peer
  50 @build java.desktop/java.awt.Helper
  51 @build Util
  52 @run main JPopupMenuOverlapping
  53  */
  54 public class JPopupMenuOverlapping extends OverlappingTestBase {
  55 
  56     {testEmbeddedFrame = true;}
  57 
  58     private boolean lwClicked = false;
  59     private Point loc;
  60     private JPopupMenu popup;
  61     private JFrame frame=null;
  62 
  63     protected void prepareControls() {
  64         if(frame != null) {
  65             frame.setVisible(false);
  66         }
  67         frame = new JFrame("Mixing : Dropdown Overlapping test");
  68         frame.setLayout(new SpringLayout());
  69         frame.setSize(200, 200);
  70