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

Print this page




  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  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 
  25 import java.awt.Color;
  26 import java.awt.Point;
  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 
  37 /**
  38  * AWT/Swing overlapping test for {@link javax.swing.JPopupMenu } component.
  39  * <p>This test creates menu and test if heavyweight component is drawn correctly then menu dropdown is shown.
  40  * <p>See base class for test info.
  41  */
  42 /*
  43 @test
  44 @summary Overlapping test for javax.swing.JScrollPane
  45 @author sergey.grinev@oracle.com: area=awt.mixing


  46 @run main JPopupMenuOverlapping
  47  */
  48 public class JPopupMenuOverlapping extends OverlappingTestBase {
  49 
  50     {testEmbeddedFrame = true;}
  51 
  52     private boolean lwClicked = false;
  53     private Point loc;
  54     private JPopupMenu popup;
  55     private JFrame frame=null;
  56 
  57     protected void prepareControls() {
  58         if(frame != null) {
  59             frame.setVisible(false);
  60         }
  61         frame = new JFrame("Mixing : Dropdown Overlapping test");
  62         frame.setLayout(new SpringLayout());
  63         frame.setSize(200, 200);
  64 
  65         popup = new JPopupMenu();




  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  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 
  25 import java.awt.Color;
  26 import java.awt.Point;
  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 @build Util
  49 @run main JPopupMenuOverlapping
  50  */
  51 public class JPopupMenuOverlapping extends OverlappingTestBase {
  52 
  53     {testEmbeddedFrame = true;}
  54 
  55     private boolean lwClicked = false;
  56     private Point loc;
  57     private JPopupMenu popup;
  58     private JFrame frame=null;
  59 
  60     protected void prepareControls() {
  61         if(frame != null) {
  62             frame.setVisible(false);
  63         }
  64         frame = new JFrame("Mixing : Dropdown Overlapping test");
  65         frame.setLayout(new SpringLayout());
  66         frame.setSize(200, 200);
  67 
  68         popup = new JPopupMenu();