Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

13
LINES

< > BotCompany Repo | #1004956 // removeFromConsole2 - opposite of addToConsole2

JavaX fragment (include)

static void removeFromConsole2(Component c) {
  JFrame frame = getFrame(c);
  if (frame == null) ret;
  Container cp = frame.getContentPane(); // This is our BorderLayout
  cp = (Container) getCenterComponent(cp);
  if (cp != c.getParent()) { print("removeFromWindow fail"); ret; }
  cp.remove(c);
  Container mainC = (Container) cp.getComponents()[0];
  cp.remove(mainC);

  replaceCenterComponent(frame.getContentPane(), mainC);
  validateFrame(frame);
}

Author comment

Began life as a copy of #1004937

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: #1004956
Snippet name: removeFromConsole2 - opposite of addToConsole2
Eternal ID of this version: #1004956/1
Text MD5: 9f21229ecc51b8dd939d13d4cd77ad2b
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-09-18 17:46:30
Source code size: 468 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 560 / 516
Referenced in: [show references]