static centerFrame(A c) { Window w = getWindow(c); if (w != null) w.setLocationRelativeTo(null); // magic trick ret c; } static centerFrame(int w, int h, A c) { ret centerFrame(setFrameSize(w, h, c)); }