static void removeFromWindow(Component c) { JFrame frame = getFrame(c); if (frame == null) ret; Container cp = frame.getContentPane(); // This is our BorderLayout if (cp != c.getParent()) { print("removeFromWindow fail"); ret; } cp.remove(c); Container mainC = (Container) cp.getComponents()[0]; cp.remove(mainC); frame.setContentPane(mainC); // magic combo to actually relayout and repaint frame.revalidate(); frame.repaint(); }
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1004937 |
Snippet name: | removeFromWindow - opposite of addToWindow |
Eternal ID of this version: | #1004937/1 |
Text MD5: | 6fc8c329f163275f512ead9e588f7e98 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-09-17 19:25:29 |
Source code size: | 469 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 529 / 537 |
Referenced in: | [show references] |