sint packFrame_minw = 150, packFrame_minh = 50; static A packFrame(final A c) { swing { Window w = getWindow(c); if (w != null) { w.pack(); int maxW = getScreenWidth()-50, maxH = getScreenHeight()-50; w.setSize( min(maxW, max(w.getWidth(), packFrame_minw)), min(maxH, max(w.getHeight(), packFrame_minh))); } } ret c; } static JFrame packFrame(ButtonGroup g) { ret packFrame(getFrame(g)); }