< prev index next >

jdk/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlapping.java

Print this page




  76         frame = new Frame("OpaqueOverlapping mixing test");
  77         final Panel panel = new Panel();
  78         panel.setLayout(null);
  79 
  80         propagateAWTControls(panel);
  81 
  82         // Overlap the buttons
  83         currentAwtControl.setBounds(30, 30, 200, 200);
  84 
  85         light = new JButton("  LW Button  ");
  86         light.setBounds(10, 10, 50, 50);
  87 
  88         // Put the components into the frame
  89         panel.add(light);
  90         frame.add(panel);
  91         frame.setBounds(50, 50, 400, 400);
  92         frame.setVisible(true);
  93 
  94         currentAwtControl.addMouseListener(new MouseAdapter() {
  95             @Override
  96             public void mouseClicked(MouseEvent e) {
  97                 panel.setComponentZOrder(light, 0);
  98                 frame.validate();
  99                 testSeq = testSeq + "0";
 100             }
 101         });
 102         light.addActionListener(new java.awt.event.ActionListener() {
 103             public void actionPerformed(java.awt.event.ActionEvent e) {
 104                 panel.setComponentZOrder(currentAwtControl, 0);
 105                 frame.validate();
 106                 testSeq = testSeq + "1";
 107             }
 108         });
 109     }
 110 
 111     @Override
 112     protected boolean performTest() {
 113         try {
 114             SwingUtilities.invokeAndWait(new Runnable() {
 115                 public void run() {
 116                     heavyLoc = currentAwtControl.getLocationOnScreen();




  76         frame = new Frame("OpaqueOverlapping mixing test");
  77         final Panel panel = new Panel();
  78         panel.setLayout(null);
  79 
  80         propagateAWTControls(panel);
  81 
  82         // Overlap the buttons
  83         currentAwtControl.setBounds(30, 30, 200, 200);
  84 
  85         light = new JButton("  LW Button  ");
  86         light.setBounds(10, 10, 50, 50);
  87 
  88         // Put the components into the frame
  89         panel.add(light);
  90         frame.add(panel);
  91         frame.setBounds(50, 50, 400, 400);
  92         frame.setVisible(true);
  93 
  94         currentAwtControl.addMouseListener(new MouseAdapter() {
  95             @Override
  96             public void mousePressed(MouseEvent e) {
  97                 panel.setComponentZOrder(light, 0);
  98                 frame.validate();
  99                 testSeq = testSeq + "0";
 100             }
 101         });
 102         light.addActionListener(new java.awt.event.ActionListener() {
 103             public void actionPerformed(java.awt.event.ActionEvent e) {
 104                 panel.setComponentZOrder(currentAwtControl, 0);
 105                 frame.validate();
 106                 testSeq = testSeq + "1";
 107             }
 108         });
 109     }
 110 
 111     @Override
 112     protected boolean performTest() {
 113         try {
 114             SwingUtilities.invokeAndWait(new Runnable() {
 115                 public void run() {
 116                     heavyLoc = currentAwtControl.getLocationOnScreen();


< prev index next >