Libraryless. Click here for Pure Java version (5043L/28K).
static <A extends Component> 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 extends Component> A centerFrame(int w, int h, A c) { ret centerFrame(setFrameSize(w, h, c)); }
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment