static int centerTopFrame_inset = 20; static JFrame centerTopFrame(Component c) { JFrame f = getFrame(c); if (f == null) null; centerFrame(f); f.setLocation(f.getLocation().x, centerTopFrame_inset); ret f; }