< prev index next >

test/jdk/java/awt/Paint/PaintNativeOnUpdate.java

Print this page




  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 import java.awt.AWTException;
  25 import java.awt.Color;
  26 import java.awt.Component;
  27 import java.awt.Frame;
  28 import java.awt.Graphics;
  29 import java.awt.Label;
  30 import java.awt.Point;
  31 
  32 /**
  33  * @test
  34  * @key headful
  35  * @bug 7157680
  36  * @library ../../../lib/testlibrary
  37  * @build ExtendedRobot
  38  * @author Sergey Bylokhov
  39  @ @run main PaintNativeOnUpdate
  40  */
  41 public final class PaintNativeOnUpdate extends Label {
  42 
  43     private boolean fullUpdate = true;
  44 
  45     public static void main(final String[] args) throws AWTException {
  46         ExtendedRobot robot = new ExtendedRobot();
  47         robot.setAutoDelay(50);
  48         final Frame frame = new Frame();
  49         final Component label = new PaintNativeOnUpdate();
  50         frame.setBackground(Color.RED);
  51         frame.add(label);
  52         frame.setSize(300, 300);
  53         frame.setUndecorated(true);
  54         frame.setLocationRelativeTo(null);
  55         frame.setVisible(true);
  56         robot.waitForIdle(1000);
  57         label.repaint();// first paint
  58         robot.waitForIdle(1000);
  59         label.repaint();// incremental paint




  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 import java.awt.AWTException;
  25 import java.awt.Color;
  26 import java.awt.Component;
  27 import java.awt.Frame;
  28 import java.awt.Graphics;
  29 import java.awt.Label;
  30 import java.awt.Point;
  31 
  32 /**
  33  * @test
  34  * @key headful
  35  * @bug 7157680
  36  * @library ../../../lib/testlibrary
  37  * @build ExtendedRobot
  38  * @author Sergey Bylokhov
  39  * @run main PaintNativeOnUpdate
  40  */
  41 public final class PaintNativeOnUpdate extends Label {
  42 
  43     private boolean fullUpdate = true;
  44 
  45     public static void main(final String[] args) throws AWTException {
  46         ExtendedRobot robot = new ExtendedRobot();
  47         robot.setAutoDelay(50);
  48         final Frame frame = new Frame();
  49         final Component label = new PaintNativeOnUpdate();
  50         frame.setBackground(Color.RED);
  51         frame.add(label);
  52         frame.setSize(300, 300);
  53         frame.setUndecorated(true);
  54         frame.setLocationRelativeTo(null);
  55         frame.setVisible(true);
  56         robot.waitForIdle(1000);
  57         label.repaint();// first paint
  58         robot.waitForIdle(1000);
  59         label.repaint();// incremental paint


< prev index next >