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

6
LINES

< > BotCompany Repo | #1009786 // componentToJComponent - for binding timers to components etc.

JavaX fragment (include)

1  
static JComponent componentToJComponent(Component c) {
2  
  if (c instanceof JComponent) ret (JComponent) c;
3  
  if (c instanceof JFrame) ret ((JFrame) c).getRootPane();
4  
  if (c == null) null;
5  
  fail("boohoo " + getClassName(c));
6  
}

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

Snippet ID: #1009786
Snippet name: componentToJComponent - for binding timers to components etc.
Eternal ID of this version: #1009786/3
Text MD5: a41a4125bebc9d954562dd30762300df
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-08-16 20:09:57
Source code size: 233 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 432 / 487
Version history: 2 change(s)
Referenced in: [show references]