Index: java/awt/Window.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/awt/Window.java,v retrieving revision 1.61 diff -u -r1.61 Window.java --- java/awt/Window.java 1 Nov 2005 23:13:32 -0000 1.61 +++ java/awt/Window.java 4 Nov 2005 20:34:23 -0000 @@ -809,14 +809,22 @@ { int x = 0; int y = 0; - + GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment (); Point center = ge.getCenterPoint (); x = center.x - (width / 2); y = center.y - (height / 2); setLocation (x, y); } - // FIXME: handle case where component is non-null. + else + { + int x = c.getX (); + int y = c.getY (); + + x += Math.abs((c.getWidth () / 2) - (width / 2)); + y += Math.abs((c.getHeight () / 2) - (height / 2)); + setLocation (x, y); + } } /**