static A centerFrame(A c) { Window w = getWindow(c); if (w != null) swing { var r = preferredScreenBounds(); w.setLocation( r.x+(r.w-w.getWidth())/2, r.y+(r.h-w.getHeight())/2); } ret c; } static A centerFrame(int w, int h, A c) { ret centerFrame(setFrameSize(w, h, c)); }