import java.awt.*;

public class RelTo {
    static Frame frame = null;
    static Window window = null;
    static Point pt = null;
    public static void main(String args[]) {
        try {
            EventQueue.invokeAndWait(new Runnable() {
                public void run() {
                    frame = new Frame("Dummy Frame");
                    window = new Window(frame);
                    window.setSize(200,200);
                    window.setLocationRelativeTo(frame);
                    window.setVisible(true);
                }
            });

            try { Thread.sleep(3000); } catch (Exception e) {}

            EventQueue.invokeAndWait(new Runnable() {
                public void run() {
                    pt = window.getLocationOnScreen();
                }
            });

            System.out.println(window);
            System.out.println(pt);
        }catch(Exception exx) {
        }
    }
}
