scope packInternalFrameInTopRightCorner. static int #marginX = 20, #marginY = 20; static A packInternalFrameInTopRightCorner(final A c) { final JInternalFrame win = getInternalFrame(c); if (win == null || getParent(win) == null) ret c; swing { win.pack(); int w = getParent(win).getWidth(); win.setLocation(w-win.getWidth()-packInternalFrameInTopRightCorner_marginX, marginY); fixInternalFrame(win); } ret c; } end scope