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).

static Window getWindow(Object o) {
  if (!o instanceof Component) ret null;
  ret swing(() -> {
    Component c = cast o;
    while (c != null) {
      if (c cast Window) ret c;
      c = c.getParent();
    }
    null;
  });
}

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: 647 / 729
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)