21 * questions.
22 */
23
24 import java.awt.AWTException;
25 import java.awt.BorderLayout;
26 import java.awt.Canvas;
27 import java.awt.Color;
28 import java.awt.Dimension;
29 import java.awt.Frame;
30 import java.awt.Graphics;
31 import java.awt.Point;
32 import java.awt.Rectangle;
33 import java.awt.Robot;
34 import java.awt.Toolkit;
35 import java.awt.event.InputEvent;
36 import java.awt.event.MouseAdapter;
37 import java.awt.event.MouseEvent;
38
39 /**
40 * @test
41 * @bug 4356202
42 * @summary Tests that getLocationOnScreen returns valid value(WindowMaker
43 * only).
44 * @author dom@sparc.spb.su:
45 */
46 public class GetScreenLocTest {
47 //Declare things used in the test, like buttons and labels here
48 static Robot robot = null;
49 private static class MyCanvas extends Canvas {
50 public Dimension getPreferredSize() {
51 return new Dimension(100, 100);
52 }
53 public void paint(Graphics g) {
54 super.paint(g);
55 g.setColor(Color.blue);
56 Rectangle r = getBounds();
57 g.fillRect(0, 0, r.width, r.height);
58 }
59 }
60 static int state = 0; // there are three states - (-1,-1),(0,0),(1,1)
|
21 * questions.
22 */
23
24 import java.awt.AWTException;
25 import java.awt.BorderLayout;
26 import java.awt.Canvas;
27 import java.awt.Color;
28 import java.awt.Dimension;
29 import java.awt.Frame;
30 import java.awt.Graphics;
31 import java.awt.Point;
32 import java.awt.Rectangle;
33 import java.awt.Robot;
34 import java.awt.Toolkit;
35 import java.awt.event.InputEvent;
36 import java.awt.event.MouseAdapter;
37 import java.awt.event.MouseEvent;
38
39 /**
40 * @test
41 * @key headful
42 * @bug 4356202
43 * @summary Tests that getLocationOnScreen returns valid value(WindowMaker
44 * only).
45 * @author dom@sparc.spb.su:
46 */
47 public class GetScreenLocTest {
48 //Declare things used in the test, like buttons and labels here
49 static Robot robot = null;
50 private static class MyCanvas extends Canvas {
51 public Dimension getPreferredSize() {
52 return new Dimension(100, 100);
53 }
54 public void paint(Graphics g) {
55 super.paint(g);
56 g.setColor(Color.blue);
57 Rectangle r = getBounds();
58 g.fillRect(0, 0, r.width, r.height);
59 }
60 }
61 static int state = 0; // there are three states - (-1,-1),(0,0),(1,1)
|