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

11
LINES

< > BotCompany Repo | #1005668 // getWindow (get window/frame of Swing component)

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2937L/17K).

1  
static Window getWindow(Object o) {
2  
  if (!o instanceof Component) ret null;
3  
  ret swing(() -> {
4  
    Component c = cast o;
5  
    while (c != null) {
6  
      if (c cast Window) ret c;
7  
      c = c.getParent();
8  
    }
9  
    null;
10  
  });
11  
}

Author comment

Began life as a copy of #1001428

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1005668
Snippet name: getWindow (get window/frame of Swing component)
Eternal ID of this version: #1005668/2
Text MD5: ac298b245edb4f40cb650af3b37f68b8
Transpilation MD5: 0e85a8b9ee614fd7e5ccffca7ead9478
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-25 20:25:59
Source code size: 237 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 524 / 589
Version history: 1 change(s)
Referenced in: [show references]